NotificationSender
class NotificationSender (View source)
Traits
Localizable |
Properties
protected ChannelManager | $manager | The notification manager instance. | |
protected Dispatcher | $bus | The Bus dispatcher instance. | |
protected Dispatcher | $events | The event dispatcher. | |
protected string|null | $locale | The locale to be used when sending notifications. |
Methods
mixed | withLocale(string $locale, Closure $callback) Run the callback with the given locale. | from Localizable |
void | __construct(ChannelManager $manager, Dispatcher $bus, Dispatcher $events, string|null $locale = null) Create a new notification sender instance. | |
void | send(Collection|array|mixed $notifiables, mixed $notification) Send the given notification to the given notifiable entities. | |
void | sendNow(Collection|array|mixed $notifiables, mixed $notification, array $channels = null) Send the given notification immediately. | |
string|null | preferredLocale(mixed $notifiable, mixed $notification) Get the notifiable's preferred locale for the notification. | |
void | sendToNotifiable(mixed $notifiable, string $id, mixed $notification, string $channel) Send the given notification to the given notifiable via a channel. | |
bool | shouldSendNotification(mixed $notifiable, mixed $notification, string $channel) Determines if the notification can be sent. | |
void | queueNotification($notifiables, $notification) Queue the given notification instances. | |
Collection|array | formatNotifiables(mixed $notifiables) Format the notifiables into a Collection / array if necessary. |
Details
mixed withLocale(string $locale, Closure $callback)
Run the callback with the given locale.
void __construct(ChannelManager $manager, Dispatcher $bus, Dispatcher $events, string|null $locale = null)
Create a new notification sender instance.
void send(Collection|array|mixed $notifiables, mixed $notification)
Send the given notification to the given notifiable entities.
void sendNow(Collection|array|mixed $notifiables, mixed $notification, array $channels = null)
Send the given notification immediately.
protected string|null preferredLocale(mixed $notifiable, mixed $notification)
Get the notifiable's preferred locale for the notification.
protected void sendToNotifiable(mixed $notifiable, string $id, mixed $notification, string $channel)
Send the given notification to the given notifiable via a channel.
protected bool shouldSendNotification(mixed $notifiable, mixed $notification, string $channel)
Determines if the notification can be sent.
protected void queueNotification($notifiables, $notification)
Queue the given notification instances.
protected Collection|array formatNotifiables(mixed $notifiables)
Format the notifiables into a Collection / array if necessary.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Notifications/NotificationSender.html