Skip to content

Instantly share code, notes, and snippets.

@ricardoaugusto
Last active October 16, 2019 20:16
Show Gist options
  • Save ricardoaugusto/b17c3ead08326baa19a19a61424fb2a3 to your computer and use it in GitHub Desktop.
Save ricardoaugusto/b17c3ead08326baa19a19a61424fb2a3 to your computer and use it in GitHub Desktop.
Customize Laravel 5.6 notification email
  1. Run php artisan make:notification MyResetPassword to create a Notification Class MyResetPassword at app/Notifications
  2. add use App\Notifications\MyResetPassword; to the User model
  3. Add this method to User model:
public function sendPasswordResetNotification($token)
{
    $this->notify(new MyResetPassword($token));
}
  1. Run php artisan command php artisan vendor:publish --tag=laravel-notifications to publish the email templates at resources/views/vendor/notifications
  2. Override the toMail() method at MyResetPassword class if needed. Instructions: https://laravel.com/docs/5.6/notifications
  3. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment