userId = $userId; $this->task = $task; $this->event = $event; } /** * Get the channels the event should broadcast on. * * @return array */ public function broadcastOn(): array { return [ new PrivateChannel('user.' . $this->userId), ]; } public function broadcastAs() { return 'volunteer.unassigned.to.task'; } }