Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function broadcastWith()
{
return array_merge($this->data, [
'id' => $this->notification->id,
'type' => $this->broadcastType(),
'type' => $this->broadcastAs(),
]);
}

Expand All @@ -97,10 +97,10 @@ public function broadcastWith()
*
* @return string
*/
public function broadcastType()
public function broadcastAs()
{
return method_exists($this->notification, 'broadcastType')
? $this->notification->broadcastType()
return method_exists($this->notification, 'broadcastAs')
? $this->notification->broadcastAs()
: get_class($this->notification);
}
}
4 changes: 2 additions & 2 deletions tests/Notifications/NotificationBroadcastChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function testNotificationIsBroadcastedWithCustomEventName()
$notifiable, $notification, $notification->toArray($notifiable)
);

$eventName = $event->broadcastType();
$eventName = $event->broadcastAs();

$this->assertSame('custom.type', $eventName);
}
Expand Down Expand Up @@ -115,7 +115,7 @@ public function toArray($notifiable)
return ['invoice_id' => 1];
}

public function broadcastType()
public function broadcastAs()
{
return 'custom.type';
}
Expand Down