diff --git a/app/Http/Controllers/Api/V1/Admin/AdminBarangayController.php b/app/Http/Controllers/Api/V1/Admin/AdminBarangayController.php index fae5ba2..3bf02b7 100644 --- a/app/Http/Controllers/Api/V1/Admin/AdminBarangayController.php +++ b/app/Http/Controllers/Api/V1/Admin/AdminBarangayController.php @@ -55,20 +55,7 @@ class AdminBarangayController extends ApiController $boundary = $this->buildPolygon($data['boundary']); $centroid = $this->calculateCentroid($boundary); - if ($tenant->boundary_polygon) { - $isContained = DB::selectOne( - 'SELECT ST_Contains(boundary_polygon, ST_GeomFromText(?, 4326, \'axis-order=long-lat\')) as contained FROM tenants WHERE id = ?', - [$boundary->toWkt(), $tenant->id] - ); - - if (! $isContained || ! $isContained->contained) { - return $this->fail( - 'The drawn Barangay boundary must lie completely within your LGU boundary.', - ['boundary' => ['The Barangay boundary is outside your LGU border.']], - 422 - ); - } - } + // Spatial validation check removed as per user request // Code auto-generation if empty $city = CityMunicipality::findOrFail($cityId); @@ -130,20 +117,7 @@ class AdminBarangayController extends ApiController $boundary = $this->buildPolygon($data['boundary']); $centroid = $this->calculateCentroid($boundary); - if ($tenant->boundary_polygon) { - $isContained = DB::selectOne( - 'SELECT ST_Contains(boundary_polygon, ST_GeomFromText(?, 4326, \'axis-order=long-lat\')) as contained FROM tenants WHERE id = ?', - [$boundary->toWkt(), $tenant->id] - ); - - if (! $isContained || ! $isContained->contained) { - return $this->fail( - 'The drawn Barangay boundary must lie completely within your LGU boundary.', - ['boundary' => ['The Barangay boundary is outside your LGU border.']], - 422 - ); - } - } + // Spatial validation check removed as per user request // Code auto-generation if empty $city = CityMunicipality::findOrFail($cityId); diff --git a/app/Http/Controllers/Api/V1/SuperAdmin/SuperAdminBarangayController.php b/app/Http/Controllers/Api/V1/SuperAdmin/SuperAdminBarangayController.php index 7a75627..4deaa77 100644 --- a/app/Http/Controllers/Api/V1/SuperAdmin/SuperAdminBarangayController.php +++ b/app/Http/Controllers/Api/V1/SuperAdmin/SuperAdminBarangayController.php @@ -52,24 +52,7 @@ class SuperAdminBarangayController extends ApiController $boundary = $this->buildPolygon($data['boundary']); $centroid = $this->calculateCentroid($boundary); - // Spatial validation check - $cityId = $data['city_municipality_id']; - $tenant = Tenant::where('city_municipality_id', $cityId)->first(); - - if ($tenant && $tenant->boundary_polygon) { - $isContained = DB::selectOne( - 'SELECT ST_Contains(boundary_polygon, ST_GeomFromText(?, 4326, \'axis-order=long-lat\')) as contained FROM tenants WHERE id = ?', - [$boundary->toWkt(), $tenant->id] - ); - - if (! $isContained || ! $isContained->contained) { - return $this->fail( - 'The drawn Barangay boundary must lie completely within the LGU/Municipality boundary.', - ['boundary' => ['The Barangay boundary is outside the LGU border.']], - 422 - ); - } - } + // Spatial validation check removed as per user request // Code auto-generation if empty $city = CityMunicipality::findOrFail($cityId); @@ -120,24 +103,7 @@ class SuperAdminBarangayController extends ApiController $boundary = $this->buildPolygon($data['boundary']); $centroid = $this->calculateCentroid($boundary); - // Spatial validation check - $cityId = $data['city_municipality_id']; - $tenant = Tenant::where('city_municipality_id', $cityId)->first(); - - if ($tenant && $tenant->boundary_polygon) { - $isContained = DB::selectOne( - 'SELECT ST_Contains(boundary_polygon, ST_GeomFromText(?, 4326, \'axis-order=long-lat\')) as contained FROM tenants WHERE id = ?', - [$boundary->toWkt(), $tenant->id] - ); - - if (! $isContained || ! $isContained->contained) { - return $this->fail( - 'The drawn Barangay boundary must lie completely within the LGU/Municipality boundary.', - ['boundary' => ['The Barangay boundary is outside the LGU border.']], - 422 - ); - } - } + // Spatial validation check removed as per user request // Code auto-generation if empty $city = CityMunicipality::findOrFail($cityId); diff --git a/commit_message.txt b/commit_message.txt index 2129799..8cc7562 100644 Binary files a/commit_message.txt and b/commit_message.txt differ diff --git a/resources/views/admin/dashboard-router.blade.php b/resources/views/admin/dashboard-router.blade.php new file mode 100644 index 0000000..62dda76 --- /dev/null +++ b/resources/views/admin/dashboard-router.blade.php @@ -0,0 +1,19 @@ +@extends('admin.layouts.app', ['pageTitle' => 'Loading Dashboard...']) + +@section('page') +