boundary_polygon) { $rings = $this->boundary_polygon->getGeometries(); $ring = $rings->first(); if ($ring) { $boundaryPoints = $ring->getGeometries() ->map(fn ($p) => ['lat' => $p->latitude, 'lng' => $p->longitude]) ->all(); } } return [ 'id' => $this->uuid, 'db_id' => $this->id, 'name' => $this->name, 'code' => $this->code, 'address_line' => $this->address_line, 'coordinates' => $this->coordinates ? [ 'lat' => $this->coordinates->latitude, 'lng' => $this->coordinates->longitude, ] : null, 'boundary_polygon' => $boundaryPoints, 'accepted_waste_types' => $this->accepted_waste_types, 'operating_hours' => $this->operating_hours, 'capacity_tons' => $this->capacity_tons, 'permit_number' => $this->permit_number, 'status' => $this->status, 'contact_person' => $this->contact_person, 'contact_phone' => $this->contact_phone, 'city_municipality' => CityMunicipalityResource::make($this->whenLoaded('cityMunicipality')), 'created_at' => $this->created_at?->toIso8601String(), ]; } }