message->receiver_id), ]; } public function broadcastWith(): array { return [ 'id' => $this->message->id, 'body' => $this->message->body, 'attachment' => $this->message->attachment, 'attachment_type' => $this->message->attachment_type, 'created_at' => $this->message->created_at->format('H:i'), 'sender' => [ 'id' => $this->message->sender->id, 'name' => $this->message->sender->name, 'avatar' => $this->message->sender->profile_photo_url ?? null, ], ]; } }