userId = $userId; $this->filename = $filename; $this->emailAddress = $emailAddress; $this->message = 'Export completato! Controlla la tua email.'; } /** * 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_completed', 'message' => $this->message, 'filename' => $this->filename, 'email' => $this->emailAddress, 'timestamp' => now()->toISOString() ]; } /** * The event's broadcast name. */ public function broadcastAs() { return 'export.completed'; } }