Files
numstation-web/routes/channels.php
2023-12-22 12:35:55 +08:00

21 lines
622 B
PHP

<?php
/*
|--------------------------------------------------------------------------
| Broadcast Channels
|--------------------------------------------------------------------------
|
| Here you may register all of the event broadcasting channels that your
| application supports. The given channel authorization callbacks are
| used to check if an authenticated user can listen to the channel.
|
*/
Broadcast::channel('App.User.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
Broadcast::channel('chat-channel', function ($user) {
return ['id' => $user->id, 'name' => $user->name];
});