Отправитель Уведомлений
класс NotificationSender (Просмотр исходного кода)
Трейты
| Localizable |
Свойства
| protected ChannelManager | $manager | Экземпляр менеджера уведомлений. | |
| protected Dispatcher | $bus | Экземпляр диспетчера очереди. | |
| protected Dispatcher | $events | Диспетчер событий. | |
| protected string|null | $locale | Язык, который будет использоваться при отправке уведомлений. |
Методы
| bool | 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 $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 / массив, если необходимо. |
Детали
bool 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 $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/5.7/Illuminate/Notifications/NotificationSender.html