feat: integrate dynamic geofence fetching, service area spatial boundaries, partner store profiles & editing with Leaflet maps, custom store portal icons, QR distribution charts with geographic/LGU filters, and optimize admin dashboards
This commit is contained in:
@@ -9,6 +9,17 @@ class ServiceAreaResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
$boundaryPoints = null;
|
||||
if ($this->boundary) {
|
||||
$rings = $this->boundary->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,
|
||||
@@ -16,6 +27,7 @@ class ServiceAreaResource extends JsonResource
|
||||
'code' => $this->code,
|
||||
'status' => $this->status,
|
||||
'description' => $this->description,
|
||||
'boundary' => $boundaryPoints,
|
||||
'barangay_count' => $this->whenCounted('barangays'),
|
||||
'barangays' => BarangayResource::collection($this->whenLoaded('barangays')),
|
||||
'created_at' => $this->created_at?->toIso8601String(),
|
||||
|
||||
Reference in New Issue
Block a user