Channel
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user