diff --git a/app/Events/UserCreated.php b/app/Events/UserCreated.php index be02996..c5274eb 100644 --- a/app/Events/UserCreated.php +++ b/app/Events/UserCreated.php @@ -3,7 +3,6 @@ namespace App\Events; use App\Models\User; -use Illuminate\Broadcasting\Channel; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow; @@ -33,12 +32,12 @@ class UserCreated implements ShouldBroadcastNow public function broadcastOn(): array { return [ - new privateChannel('admins-private'), + new privateChannel('users.registration'), ]; } public function broadcastAs() { - return 'user.created'; + return 'users.registration'; } } diff --git a/routes/channels.php b/routes/channels.php index dc78b42..5e365ef 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -3,7 +3,7 @@ use Illuminate\Support\Facades\Broadcast; -Broadcast::channel('admins-private', function ($user) { +Broadcast::channel('users.registration', function ($user) { return in_array($user->role, [1, 2]); });