userId = $userId; $this->vmId = $vmId; $this->status = $status; $this->message = $message; } /** * Get the channels the event should broadcast on. * * @return \Illuminate\Broadcasting\Channel|array */ public function broadcastOn() { // Broadcast on a private channel for the user return new PrivateChannel('user.' . $this->userId); } /** * The event's broadcast name. * * @return string */ public function broadcastAs() { return 'vm.status.changed'; } }