You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: notifications.md
+18-2Lines changed: 18 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -563,6 +563,24 @@ The `broadcast` channel broadcasts notifications using Laravel's [event broadcas
563
563
]);
564
564
}
565
565
566
+
In addition to the data you specify, broadcast notifications will also contain a `type` field containing the class name of the notification.
567
+
568
+
#### Customizing The Notification Type
569
+
570
+
If you would like to customize notification type that is passed to your JavaScript client, you may define a `broadcastType` method in the notification class:
571
+
572
+
use Illuminate\Notifications\Messages\BroadcastMessage;
573
+
574
+
/**
575
+
* Get the type of the notification being broadcast.
576
+
*
577
+
* @return string
578
+
*/
579
+
public function broadcastType($notifiable)
580
+
{
581
+
return 'broadcast.message';
582
+
}
583
+
566
584
#### Broadcast Queue Configuration
567
585
568
586
All broadcast notifications are queued for broadcasting. If you would like to configure the queue connection or queue name that is used to queue the broadcast operation, you may use the `onConnection` and `onQueue` methods of the `BroadcastMessage`:
@@ -571,8 +589,6 @@ All broadcast notifications are queued for broadcasting. If you would like to co
571
589
->onConnection('sqs')
572
590
->onQueue('broadcasts');
573
591
574
-
> {tip} In addition to the data you specify, broadcast notifications will also contain a `type` field containing the class name of the notification.
0 commit comments