更新时间:2023-02-17 09:38:20
尝试一下:
用户模型:
User Model:
public function sendPasswordResetNotification($token) {
return $this->notify(new PasswordReset($token, $this->username));
}
App \ Notifications \ PasswordReset:
App\Notifications\PasswordReset:
class PasswordReset extends Notification
{
use Queueable;
public $username;
public function __construct($token, $username)
{
$this->username = $username;
}
public function via($notifiable)
{
return ['mail'];
}
public function toMail($notifiable)
{
return (new MailMessage)
->greeting('Hello '.$this->username.',')
->line('The introduction to the notification.')
->action('Notification Action', 'https://laravel.com')
->line('Thank you for using our application!');
}
}