fix private channel
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use App\Models\User;
|
||||
use App\Models\Channel;
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Broadcast Channels
|
||||
@@ -13,10 +15,10 @@ use Illuminate\Support\Facades\Broadcast;
|
||||
|
|
||||
*/
|
||||
|
||||
// Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
||||
// return (int) $user->id === (int) $id;
|
||||
// });
|
||||
|
||||
Broadcast::channel('chat.{id}', function ($user, $id) {
|
||||
return true;
|
||||
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
||||
return (int) $user->id === (int) $id;
|
||||
});
|
||||
|
||||
Broadcast::channel('chat.{room_id}', function ($user, $room_id) {
|
||||
return Auth::check();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user