ledgerrz/routes/channels.php
Daan Meijer b2a7e2557e
Some checks failed
linter / quality (push) Failing after 1m5s
tests / ci (8.3) (push) Failing after 51s
tests / ci (8.4) (push) Failing after 1m6s
tests / ci (8.5) (push) Failing after 1m7s
dashboard gereparerd
2026-07-06 15:53:30 +02:00

13 lines
294 B
PHP

<?php
use App\Models\Chat;
use Illuminate\Support\Facades\Broadcast;
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
Broadcast::channel('chats.{chat}', function ($user, Chat $chat) {
return $user?->can('view', $chat);
});