NotificationSender
класс NotificationSender (View source)
Черты
| Localizable |
Свойства
| protected ChannelManager | $manager | Экземпляр менеджера уведомлений. | |
| protected Dispatcher | $bus | Экземпляр диспетчера Bus. | |
| protected Dispatcher | $events | Диспетчер событий. | |
| protected string|null | $locale | Локаль, используемая при отправке уведомлений. |
Методы
| mixed | withLocale(string $locale, Closure $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|null $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)
Выполнить обратный вызов с заданной локалью.
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|null $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/11.x/Illuminate/Notifications/NotificationSender.html