3 use App\Models\Tournament;
4 use Illuminate\Support\Facades\Broadcast;
7 |--------------------------------------------------------------------------
9 |--------------------------------------------------------------------------
11 | Here you may register all of the event broadcasting channels that your
12 | application supports. The given channel authorization callbacks are
13 | used to check if an authenticated user can listen to the channel.
17 Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
18 return (int) $user->id === (int) $id;
21 Broadcast::channel('App.Control', function ($user) {
25 Broadcast::channel('Protocol.{id}', function ($user, $id) {
26 $tournament = Tournament::findOrFail($id);
27 return $user->can('viewProtocol', $tournament);
30 Broadcast::channel('Tournament.{id}', function ($user, $id) {
31 $tournament = Tournament::findOrFail($id);