feat: implement interactive Barangay polygon map selector in Service Areas
This commit is contained in:
@@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user