NotificationSender
class NotificationSender (View source)
Трейты
| Localizable |
Свойства
| protected ChannelManager | $manager | Экземпляр менеджера уведомлений. | |
| protected Dispatcher | $bus | Экземпляр диспетчера Bus. | |
| protected Dispatcher | $events | Диспетчер событий. | |
| protected string|null | $locale | Язык, который будет использоваться при отправке уведомлений. |
Методы
| mixed | withLocale(string $locale, Closure $callback)
Выполнить callback с заданным языком. | из Localizable |
| 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/массив, если необходимо. |
Подробности
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)
Форматировать уведомления в Коллекцию / массив, если необходимо.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/6.x/Illuminate/Notifications/NotificationSender.html