message = $message; } /** * Get the channels the event should broadcast on. * * @return array */ public function broadcastOn(): array { return [ new PrivateChannel('conversation.' . $this->message->conversation_id), ]; } /** * Data to broadcast. */ public function broadcastWith(): array { return [ 'message' => new MessageResource($this->message->load('user')), ]; } }