| 1 | <?php | = | 1 | <?php |
| 2 | 2 | |||
| -+ | 3 | use Illuminate\Support\Facades\Broadcast; | ||
| 4 | ||||
| 3 | /* | = | 5 | /* |
| 4 | |-------------------------------------------------------------------------- | 6 | |-------------------------------------------------------------------------- | |
| 5 | | Broadcast Channels | 7 | | Broadcast Channels | |
| 6 | |-------------------------------------------------------------------------- | 8 | |-------------------------------------------------------------------------- | |
| 7 | | | 9 | | | |
| 8 | | Here you may register all of the event broadcasting channels that your | 10 | | Here you may register all of the event broadcasting channels that your | |
| 9 | | application supports. The given channel authorization callbacks are | 11 | | application supports. The given channel authorization callbacks are | |
| 10 | | used to check if an authenticated user can listen to the channel. | 12 | | used to check if an authenticated user can listen to the channel. | |
| 11 | | | 13 | | | |
| 12 | */ | 14 | */ | |
| 13 | 15 | |||
| 14 | Broadcast::channel('App.User.{id}', function ($user, $id) { | 16 | Broadcast::channel('App.User.{id}', function ($user, $id) { | |
| 15 | return (int) $user->id === (int) $id; | 17 | return (int) $user->id === (int) $id; | |
| 16 | }); | 18 | }); |