Laravel Illuminate class 未找到邮件重置
Lavarel Illuminate class for mail reset not found
我将通知 class 作为 MailResetPasswordNotification
并使用以下内容编辑了通知的邮件表示。
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!');
}
我还在 vendor/laravel/framework/src/illuminate/Auth/Passwords/CanResetPassword.php
中找到了用于重置密码的文件,并用我的文件覆盖了它,例如:
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));
}
}
但是,我收到以下错误。
Class 'Illuminate\Auth\Passwords\App\Notifications\MailResetPasswordNotification' not found
您需要在实现 CanResetPassword
的 class 中创建方法 sendPasswordResetNotification
我将通知 class 作为 MailResetPasswordNotification
并使用以下内容编辑了通知的邮件表示。
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!');
}
我还在 vendor/laravel/framework/src/illuminate/Auth/Passwords/CanResetPassword.php
中找到了用于重置密码的文件,并用我的文件覆盖了它,例如:
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));
}
}
但是,我收到以下错误。
Class 'Illuminate\Auth\Passwords\App\Notifications\MailResetPasswordNotification' not found
您需要在实现 CanResetPassword
sendPasswordResetNotification