Files
backend-mm/routes/channels.php
Mekan1206 005b428cf1 Channel
2026-05-01 16:53:04 +05:00

23 lines
716 B
PHP

<?php
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\Facades\DB;
/*
|--------------------------------------------------------------------------
| Broadcast Channels
|--------------------------------------------------------------------------
|
| Here you may register all of the event broadcasting channels that your
| application supports. The given channel authorization callbacks are
| used to check if an authenticated user can listen to the channel.
|
*/
Broadcast::channel('chat.{conversationId}', function ($user, $conversationId) {
return DB::table('conversation_user')
->where('conversation_id', $conversationId)
->where('user_id', $user->id)
->exists();
});