Skip to content

Commit

Permalink
Add missing toBroadcast method (#17)
Browse files Browse the repository at this point in the history
* require illuminate-broadcasting-backport

* added missing support for the toBroadcast method for the broadcast channel
  • Loading branch information
osteel authored and mpociot committed Nov 22, 2016
1 parent 98401c0 commit 51e8633
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Notifications/Channels/BroadcastChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public function send($notifiable, Notification $notification)
*/
protected function getData($notifiable, Notification $notification)
{
if (method_exists($notification, 'toBroadcast')) {
return $notification->toBroadcast($notifiable);
}

if (method_exists($notification, 'toArray')) {
return $notification->toArray($notifiable);
}
Expand Down

0 comments on commit 51e8633

Please sign in to comment.