class NotificationSender (View source)

Properties

protected ChannelManager $manager The notification manager instance.
protected Dispatcher $bus The Bus dispatcher instance.
protected Dispatcher $events The event dispatcher.

Methods

void
__construct(ChannelManager $manager, Dispatcher $bus, Dispatcher $events)

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.

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(mixed $notifiables, Notification] $notification)

Queue the given notification instances.

Collection|array
formatNotifiables(mixed $notifiables)

Format the notifiables into a Collection / array if necessary.

Details

void __construct(ChannelManager $manager, Dispatcher $bus, Dispatcher $events)

Create a new notification sender instance.

Parameters

ChannelManager $manager
Dispatcher $bus
Dispatcher $events

Return Value

void

void send(Collection|array|mixed $notifiables, mixed $notification)

Send the given notification to the given notifiable entities.

Parameters

Collection|array|mixed $notifiables
mixed $notification

Return Value

void

void sendNow(Collection|array|mixed $notifiables, mixed $notification, array $channels = null)

Send the given notification immediately.

Parameters

Collection|array|mixed $notifiables
mixed $notification
array $channels

Return Value

void

protected void sendToNotifiable(mixed $notifiable, string $id, mixed $notification, string $channel)

Send the given notification to the given notifiable via a channel.

Parameters

mixed $notifiable
string $id
mixed $notification
string $channel

Return Value

void

protected bool shouldSendNotification(mixed $notifiable, mixed $notification, string $channel)

Determines if the notification can be sent.

Parameters

mixed $notifiable
mixed $notification
string $channel

Return Value

bool

protected void queueNotification(mixed $notifiables, Notification] $notification)

Queue the given notification instances.

Parameters

mixed $notifiables
Notification] $notification

Return Value

void

protected Collection|array formatNotifiables(mixed $notifiables)

Format the notifiables into a Collection / array if necessary.

Parameters

mixed $notifiables

Return Value

Collection|array