Laravel 5.3 Notification Vs Mailable

后端 未结 2 814
我在风中等你
我在风中等你 2021-02-02 06:17

I am a little confused about whether to use Laravel\'s Notification or Mailable class. From what I understand, Mailables are used to send only emails whereas Notifications can b

2条回答
  •  借酒劲吻你
    2021-02-02 07:23

    Although it is not in the documentation, as of Laravel 5.3.7, the Notifications mail channel can work with Mailable objects in addition to the notification MailMessage objects.

    Therefore, you can create all your emails as Mailable objects, and if you decide to send them via Notifications, you would just have your toMail() method return the Mailable objects you've already made.

提交回复
热议问题