feat: implement interactive Barangay polygon map selector in Service Areas

This commit is contained in:
Developer
2026-06-29 13:22:45 +08:00
parent 00cf5fb7ab
commit 2c7c3528e4
9 changed files with 304 additions and 33 deletions

View File

@@ -22,6 +22,16 @@ class UserResource extends JsonResource
'email_verified_at' => $this->email_verified_at?->toIso8601String(),
'phone_verified_at' => $this->phone_verified_at?->toIso8601String(),
'last_login_at' => $this->last_login_at?->toIso8601String(),
'tenant' => $this->relationLoaded('tenant') && $this->tenant ? [
'id' => $this->tenant->uuid,
'name' => $this->tenant->name,
'code' => $this->tenant->code,
'boundary_polygon' => $this->tenant->boundary_polygon ? (function ($poly) {
$rings = $poly->getGeometries();
$ring = $rings->first();
return $ring ? $ring->getGeometries()->map(fn ($p) => ['lat' => $p->latitude, 'lng' => $p->longitude])->all() : null;
})($this->tenant->boundary_polygon) : null,
] : null,
];
}
}