report = $report; $this->changeType = $changeType ?? ($report['change_type'] ?? null); } /** * Get the channels the event should broadcast on. * * @return \Illuminate\Broadcasting\Channel|array */ public function broadcastOn() { return new Channel('reports'); } /** * Get the data to broadcast. * * @return array */ public function broadcastWith() { return [ 'report' => $this->report, 'change_type' => $this->changeType, 'timestamp' => now()->toIso8601String() ]; } }