mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
These are very similar to routes in that they are channel endpoints that your application supports and they also fully support route model binding in Laravel 5.4. Upgraded applications do not need to make this change if they do not want to.
17 lines
508 B
PHP
17 lines
508 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;
|
|
});
|