Skip to content

Commit bb9284f

Browse files
authored
Bugfix
Laravel will notify all routes, even if a notification is being sent through a single route only, like: ``` Notification::route('nexmo', $number)->notify(new Notification()); ``` Will also invoke the send method of WebPushChannel, but the array key won't exist, and thus it throws an exception when trying to call ->isEmpty()
1 parent 89b9f2f commit bb9284f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/WebPushChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function send($notifiable, Notification $notification)
3030
{
3131
$subscriptions = $notifiable->routeNotificationFor('WebPush');
3232

33-
if ($subscriptions->isEmpty()) {
33+
if (! $subscriptions || $subscriptions->isEmpty()) {
3434
return;
3535
}
3636

0 commit comments

Comments
 (0)