1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-21 23:32:39 +00:00
pixelfed/routes/channels.php
2022-06-26 16:06:08 -06:00

24 lines
755 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('live.chat.{id}', function ($user, $id) {
return true;
}, ['guards' => ['web', 'api']]);
Broadcast::channel('live.presence.{id}', function ($user, $id) {
return [ $user->profile_id ];
}, ['guards' => ['web', 'api']]);