Skip to content

Commit

Permalink
Fix UUIDs when queueing.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 24, 2016
1 parent e209d1a commit 18d26df
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Illuminate/Notifications/ChannelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public function sendNow($notifiables, $notification, array $channels = null)
foreach ($channels as $channel) {
$notification = clone $original;

$notification->id = $notificationId;
if (! $notification->id) {
$notification->id = $notificationId;
}

if (! $this->shouldSendNotification($notifiable, $notification, $channel)) {
continue;
Expand Down Expand Up @@ -111,8 +113,16 @@ protected function queueNotification($notifiables, $notification)

$bus = $this->app->make(Bus::class);

$original = clone $notification;

foreach ($notifiables as $notifiable) {
$notificationId = (string) Uuid::uuid4();

foreach ($notification->via($notifiable) as $channel) {
$notification = clone $original;

$notification->id = $notificationId;

$bus->dispatch(
(new SendQueuedNotifications($this->formatNotifiables($notifiable), $notification, [$channel]))
->onConnection($notification->connection)
Expand Down

0 comments on commit 18d26df

Please sign in to comment.