ledgerrz/routes/channels.php
2026-06-15 00:44:55 +02:00

13 lines
303 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->chatable);
});