G
G
GrimJack2017-07-20 20:28:50
Laravel
GrimJack, 2017-07-20 20:28:50

How to change laravel 5.4 password change message?

I've been fighting for 3 hours now. Google did not help absolutely, everywhere they refer to documentation that says the same as I do.
In app/User.php added

public function sendPasswordResetNotification($token)
    {
        $this->notify((new MailMessage)
            ->subject('password reset')
            ->action('Reset Password', url(config('app.url').route('password.reset', $token, false))));
    }

However, I get the error
Call to undefined method Illuminate\Notifications\Messages\MailMessage::via()
in NotificationSender.php (line 84) Can you tell me
how to change the letter without much gesture in the form of rewriting the send to mail function?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JSmitty, 2017-07-20
@JSmitty

I don’t remember exactly, when you deploy authorization through artisan, the template of this letter appears in the views, and you can fix it there without touching the code.

P
PashaNedved, 2017-07-20
@PashaNedved

Add a method to the User model

public function sendPasswordResetNotification($token)
{
    $this->notify(new ResetPasswordNotification($token));
}

Create a notification class
artisan make:notification ResetPasswordNotification

Customize the notification in the ResetPasswordNotification class, not in the User model.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question