X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=routes%2Fchannels.php;h=e93d25e9c284e4afa7c4c91876f6688e97133590;hb=7caf2ef743d7eeb9adf8494b1d194998886226e8;hp=5d451e1fae88c81c097aa55de6ff039a3cc0a1c3;hpb=4bf2dd1dd1f6d31b2ebe299b7495a8b0e259ec77;p=alttp.git diff --git a/routes/channels.php b/routes/channels.php index 5d451e1..e93d25e 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -1,5 +1,6 @@ id === (int) $id; + return (int) $user->id === (int) $id; +}); + +Broadcast::channel('App.Control', function ($user) { + return true; +}); + +Broadcast::channel('Protocol.{id}', function ($user, $id) { + $tournament = Tournament::findOrFail($id); + return $user->can('viewProtocol', $tournament); +}); + +Broadcast::channel('Tournament.{id}', function ($user, $id) { + $tournament = Tournament::findOrFail($id); + return true; });