Skip to content

Commit

Permalink
support viaQueues method
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed May 11, 2020
1 parent 880b637 commit e97d17c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Illuminate/Notifications/NotificationSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,16 @@ protected function queueNotification($notifiables, $notification)
$notification->locale = $this->locale;
}

$queue = $notification->queue;

if (method_exists($notification, 'viaQueues')) {
$queue = $notification->viaQueues()[$channel] ?? null;

This comment has been minimized.

Copy link
@bholub

bholub May 13, 2020

Contributor

Quick question; should this not fall back to $notification->queue instead of 'null'? Just wondering what would happen if the user defines viaQueues() but does not include all channels there. Thanks!

}

$this->bus->dispatch(
(new SendQueuedNotifications($notifiable, $notification, [$channel]))
->onConnection($notification->connection)
->onQueue($notification->onQueues[$channel] ?? $notification->queue)
->onQueue($queue)
->delay($notification->delay)
->through(
array_merge(
Expand Down

0 comments on commit e97d17c

Please sign in to comment.