You need to edit the function toMailin App\Notifications\PasswordResetto set greetinghow you want.
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!');
}
Update
To set $username, you must define the variable method and setter in App\Notifications\PasswordReset.
protected $username = null;
public function setName($name) {
$this->username = $name;
}
During initialization, App\Notifications\PasswordResetyou can set a name.
In the model, Userupdate the function as shown below.
public function sendPasswordResetNotification($token) {
$resetNotification = new ResetPasswordNotification($token);
$resetNotification->setName($this->name);
$this->notify($resetNotification);
}
source
share