rename admins-private to users.registration
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
namespace App\Events;
|
namespace App\Events;
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Broadcasting\Channel;
|
|
||||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||||
use Illuminate\Broadcasting\PrivateChannel;
|
use Illuminate\Broadcasting\PrivateChannel;
|
||||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
|
||||||
@@ -33,12 +32,12 @@ class UserCreated implements ShouldBroadcastNow
|
|||||||
public function broadcastOn(): array
|
public function broadcastOn(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
new privateChannel('admins-private'),
|
new privateChannel('users.registration'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function broadcastAs()
|
public function broadcastAs()
|
||||||
{
|
{
|
||||||
return 'user.created';
|
return 'users.registration';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
use Illuminate\Support\Facades\Broadcast;
|
use Illuminate\Support\Facades\Broadcast;
|
||||||
|
|
||||||
|
|
||||||
Broadcast::channel('admins-private', function ($user) {
|
Broadcast::channel('users.registration', function ($user) {
|
||||||
return in_array($user->role, [1, 2]);
|
return in_array($user->role, [1, 2]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user