-1

When I try to send reset password notification, this error occurs

Attempt to read property "view" on null

this is the code line on which this error occurs

$this->notify(new ResetPasswordNotification($token));

this is my code inside notification class enter image description here

Mohsin Ali
  • 360
  • 2
  • 12
  • 1
    Please do not post code images, instead post your actual code into your question. – ThS Oct 06 '22 at 09:58

2 Answers2

0

You need this method in User model:

public function sendPasswordResetNotification($token): void
{
    $this->notify(new ResetPassword($token, $this));
}

You must pass user with token

knubbe
  • 1,132
  • 2
  • 12
  • 21
0

You need to return the MailMessage in toMail like so:

return $this->buildMailMessage($this->resetUrl($notification));
ThS
  • 4,597
  • 2
  • 15
  • 27