*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'conversation_id' => $this->conversation_id, 'body' => $this->body, 'seen_at' => $this->seen_at, 'user' => new ChatUserResource($this->whenLoaded('user')), 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, ]; } }