*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'slug' => $this->slug, 'name' => $this->name, 'country' => $this->country, 'latitude' => (float) $this->latitude, 'longitude' => (float) $this->longitude, 'wikipedia_summary' => $this->wikipedia_summary, 'wikipedia_url' => $this->wikipedia_url, 'attractions_count' => $this->whenCounted('attractions'), 'attractions' => AttractionResource::collection($this->whenLoaded('attractions')), 'created_at' => $this->created_at?->toISOString(), 'updated_at' => $this->updated_at?->toISOString(), ]; } }