- Run
php artisan make:notification MyResetPassword
to create a Notification ClassMyResetPassword
atapp/Notifications
- add
use App\Notifications\MyResetPassword;
to the User model - Add this method to User model:
public function sendPasswordResetNotification($token)
{
$this->notify(new MyResetPassword($token));
}
- Run
php artisan command php artisan vendor:publish --tag=laravel-notifications
to publish the email templates atresources/views/vendor/notifications
- Override the
toMail()
method atMyResetPassword
class if needed. Instructions: https://laravel.com/docs/5.6/notifications - Open the
resources/views/vendor/notifications/email.blade.php
and customize it
Source: https://stackoverflow.com/a/39610301
Laracast video: https://laracasts.com/series/whats-new-in-laravel-5-3/episodes/9