From 496751e73b46815fc7e36163506cbdbab025a9f6 Mon Sep 17 00:00:00 2001 From: wuweixin Date: Sun, 1 Jan 2017 19:39:07 +0800 Subject: [PATCH 1/2] Update ChannelManager.php --- src/Illuminate/Notifications/ChannelManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Notifications/ChannelManager.php b/src/Illuminate/Notifications/ChannelManager.php index 6d8ca5d8fe29..cd0a3b842707 100644 --- a/src/Illuminate/Notifications/ChannelManager.php +++ b/src/Illuminate/Notifications/ChannelManager.php @@ -50,7 +50,7 @@ public function send($notifiables, $notification) * @param mixed $notification * @return void */ - public function sendNow($notifiables, $notification, array $channels = null) + public function sendNow($notifiables, $notification, array $use_channels = null) { $notifiables = $this->formatNotifiables($notifiables); @@ -59,7 +59,7 @@ public function sendNow($notifiables, $notification, array $channels = null) foreach ($notifiables as $notifiable) { $notificationId = Uuid::uuid4()->toString(); - $channels = $channels ?: $notification->via($notifiable); + $channels = $use_channels ?: $notification->via($notifiable); if (empty($channels)) { continue; From b8d65c780b9e71bbca26f6ce14e805411757d715 Mon Sep 17 00:00:00 2001 From: Wu Weixin Date: Sun, 1 Jan 2017 19:49:35 +0800 Subject: [PATCH 2/2] change channels variable name --- src/Illuminate/Notifications/ChannelManager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Notifications/ChannelManager.php b/src/Illuminate/Notifications/ChannelManager.php index cd0a3b842707..b738b19c4068 100644 --- a/src/Illuminate/Notifications/ChannelManager.php +++ b/src/Illuminate/Notifications/ChannelManager.php @@ -50,7 +50,7 @@ public function send($notifiables, $notification) * @param mixed $notification * @return void */ - public function sendNow($notifiables, $notification, array $use_channels = null) + public function sendNow($notifiables, $notification, array $channels = null) { $notifiables = $this->formatNotifiables($notifiables); @@ -59,13 +59,13 @@ public function sendNow($notifiables, $notification, array $use_channels = null) foreach ($notifiables as $notifiable) { $notificationId = Uuid::uuid4()->toString(); - $channels = $use_channels ?: $notification->via($notifiable); + $viaChannels = $channels ?: $notification->via($notifiable); - if (empty($channels)) { + if (empty($viaChannels)) { continue; } - foreach ($channels as $channel) { + foreach ($viaChannels as $channel) { $notification = clone $original; if (! $notification->id) {