NotificationSender
in package
Table of Contents
- $bus : Dispatcher
- The Bus dispatcher instance.
- $events : Dispatcher
- The event dispatcher.
- $manager : ChannelManager
- The notification manager instance.
- __construct() : void
- Create a new notification sender instance.
- send() : void
- Send the given notification to the given notifiable entities.
- sendNow() : void
- Send the given notification immediately.
- formatNotifiables() : Collection|array<string|int, mixed>
- Format the notifiables into a Collection / array if necessary.
- queueNotification() : void
- Queue the given notification instances.
- sendToNotifiable() : void
- Send the given notification to the given notifiable via a channel.
- shouldSendNotification() : bool
- Determines if the notification can be sent.
Properties
$bus
The Bus dispatcher instance.
protected
Dispatcher
$bus
$events
The event dispatcher.
protected
Dispatcher
$events
$manager
The notification manager instance.
protected
ChannelManager
$manager
Methods
__construct()
Create a new notification sender instance.
public
__construct(ChannelManager $manager, Dispatcher $bus, Dispatcher $events) : void
Parameters
- $manager : ChannelManager
- $bus : Dispatcher
- $events : Dispatcher
Return values
void —send()
Send the given notification to the given notifiable entities.
public
send(Collection|array<string|int, mixed>|mixed $notifiables, mixed $notification) : void
Parameters
- $notifiables : Collection|array<string|int, mixed>|mixed
- $notification : mixed
Return values
void —sendNow()
Send the given notification immediately.
public
sendNow(Collection|array<string|int, mixed>|mixed $notifiables, mixed $notification[, array<string|int, mixed> $channels = null ]) : void
Parameters
- $notifiables : Collection|array<string|int, mixed>|mixed
- $notification : mixed
- $channels : array<string|int, mixed> = null
Return values
void —formatNotifiables()
Format the notifiables into a Collection / array if necessary.
protected
formatNotifiables(mixed $notifiables) : Collection|array<string|int, mixed>
Parameters
- $notifiables : mixed
Return values
Collection|array<string|int, mixed> —queueNotification()
Queue the given notification instances.
protected
queueNotification(mixed $notifiables, mixed $notification) : void
Parameters
- $notifiables : mixed
- $notification : mixed
Return values
void —sendToNotifiable()
Send the given notification to the given notifiable via a channel.
protected
sendToNotifiable(mixed $notifiable, string $id, mixed $notification, string $channel) : void
Parameters
- $notifiable : mixed
- $id : string
- $notification : mixed
- $channel : string
Return values
void —shouldSendNotification()
Determines if the notification can be sent.
protected
shouldSendNotification(mixed $notifiable, mixed $notification, string $channel) : bool
Parameters
- $notifiable : mixed
- $notification : mixed
- $channel : string