]> git.localhorst.tv Git - alttp.git/blobdiff - routes/channels.php
add up to 4 player support for zsr sync
[alttp.git] / routes / channels.php
index 4581feb7df93cf85c1b5501370046d7c1e6cc18a..b0a25526a12701f2f783d06a128c48433c7be02c 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+use App\Models\Channel;
 use App\Models\Tournament;
 use Illuminate\Support\Facades\Broadcast;
 
@@ -22,6 +23,16 @@ Broadcast::channel('App.Control', function ($user) {
        return true;
 });
 
+Broadcast::channel('Channel.{id}', function ($user, $id) {
+       $channel = Channel::findOrFail($id);
+       return $user->can('editRestream', $channel);
+});
+
+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;