jeudi 25 janvier 2018

Laravel: get email recipient from within the mail template

When using Notifications in Laravel (5.5), you can access the Notifiable (the recipient) from within the toMail() method.

Is there an equivalent way to access the recipient when you are sending a Mailable?

Is there a better solution than just repeating the User instance in the constructor like this?

Mail::to($user)->send(new EventAlert($user));



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire