This commit is contained in:
Mekan1206
2026-05-01 16:53:04 +05:00
parent f772562376
commit 005b428cf1
12 changed files with 261 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
<?php
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\Facades\DB;
/*
|--------------------------------------------------------------------------
@@ -12,3 +13,10 @@ use Illuminate\Support\Facades\Broadcast;
| 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();
});