NotificationSender
class NotificationSender (View source)
Traits
| Локализуемый |
Properties
| protected ChannelManager | $manager | Экземпляр менеджера уведомлений. | |
| protected Dispatcher | $bus | Экземпляр диспетчера очереди. | |
| protected Dispatcher | $events | Диспетчер событий. | |
| protected string|null | $locale | Язык, который будет использоваться при отправке уведомлений. |
Methods
| mixed | withLocale(string $locale, Closure $callback)
Выполнить callback с заданным языком. | from Локализуемый |
| void | __construct(ChannelManager $manager, Dispatcher $bus, Dispatcher $events, string|null $locale = null)
Создать новый экземпляр отправителя уведомлений. | |
| void | send(Collection|array|mixed $notifiables, mixed $notification)
Отправить заданное уведомление указанным сущностям. | |
| void | sendNow(Collection|array|mixed $notifiables, mixed $notification, array $channels = null)
Отправить уведомление немедленно. | |
| string|null | preferredLocale(mixed $notifiable, mixed $notification)
Получить предпочтительный язык получателя для уведомления. | |
| void | sendToNotifiable(mixed $notifiable, string $id, mixed $notification, string $channel)
Отправить уведомление получателю через указанный канал. | |
| bool | shouldSendNotification(mixed $notifiable, mixed $notification, string $channel)
Определяет, можно ли отправить уведомление. | |
| void | queueNotification(mixed $notifiables, Notification $notification)
Поместить уведомление в очередь. | |
| Collection|array | formatNotifiables(mixed $notifiables)
Форматировать получателей в Collection или массив, если необходимо. |
Details
mixed withLocale(string $locale, Closure $callback)
Выполнить callback с заданным языком.
void __construct(ChannelManager $manager, Dispatcher $bus, Dispatcher $events, string|null $locale = null)
Создать новый экземпляр отправителя уведомлений.
void send(Collection|array|mixed $notifiables, mixed $notification)
Отправить заданное уведомление указанным сущностям.
void sendNow(Collection|array|mixed $notifiables, mixed $notification, array $channels = null)
Отправить уведомление немедленно.
protected string|null preferredLocale(mixed $notifiable, mixed $notification)
Получить предпочтительный язык получателя для уведомления.
protected void sendToNotifiable(mixed $notifiable, string $id, mixed $notification, string $channel)
Отправить уведомление получателю через указанный канал.
protected bool shouldSendNotification(mixed $notifiable, mixed $notification, string $channel)
Определяет, можно ли отправить уведомление.
protected void queueNotification(mixed $notifiables, Notification $notification)
Поместить уведомление в очередь.
protected Collection|array formatNotifiables(mixed $notifiables)
Форматировать уведомления в Collection / массив, если необходимо.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Notifications/NotificationSender.html