jeudi 4 avril 2019

Laravel 5.4 dynamic notification types

I'm designing a mass notification system that requires the user to have the option of sending the notifications via mail, sms or both. I'm using the notification facade and trying to allow for that with something like the deliverVia() method that exists in Illuminate\Notifications\ChannelManager like so:

$notificationType = 'mail';
Notification::send($customers, new MassCommunicationTool($data))->deliverVia($notificationType);

This errors out with

Call to a member function deliverVia() on null

Is anyone familiar with a good solution for this? I know deliverVia() does expect a string that is the channel, I've just never seen in combined with the notification facade before.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire