jeudi 5 décembre 2019

Lavarel -Illuminate class for mail reset not found

I made notification class as MailResetPasswordNotification and edited mail representation of the nofication with:

public function toMail($notifiable)
{
    $link = url( "/password/reset/?token=" . $this->token );

    return ( new MailMessage )
        ->view('reset.emailer')
        ->from('info@example.com')
        ->subject( 'Reset your password' )
        ->line( "Hey, We've successfully changed the text " )
        ->action( 'Reset Password', $link )
        ->attach('reset.attachment')
        ->line( 'Thank you!' );
}

and found file for reseting password in vendor/laravel/framework/src/illuminate/Auth/Passwords/CanResetPassword.php and overrided it with mine like:

namespace Illuminate\Auth\Passwords;
**use Illuminate\Auth\Notifications\ResetPassword as MailResetPasswordNotification;**

trait CanResetPassword
{

    public function getEmailForPasswordReset()
    {
        return $this->email;
    }


public function sendPasswordResetNotification($token)
{
    $this->notify(new App\Notifications\MailResetPasswordNotification($token));
}

}

and I get error:

Class 'Illuminate\Auth\Passwords\App\Notifications\MailResetPasswordNotification' not found



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire