userId = $userId; $this->errorMessage = $errorMessage; $this->message = 'Export fallito. Riprova o contatta il supporto.'; } /** * Get the channels the event should broadcast on. */ public function broadcastOn() { return new PrivateChannel('exports.' . $this->userId); } /** * Get the data to broadcast. */ public function broadcastWith() { return [ 'type' => 'export_failed', 'message' => $this->message, 'error' => $this->errorMessage, 'timestamp' => now()->toISOString() ]; } /** * The event's broadcast name. */ public function broadcastAs() { return 'export.failed'; } }