Files
Verde-Web/app/Http/Controllers/Api/V1/Admin/AdminTenantController.php
Azure_0_ ee72cd7211 feat: segregate super admin and LGU admin workflows
- Created AdminBarangayController to strictly scope barangay management to LGU boundaries
- Created AdminTenantController for LGU admins to fetch their own tenant configurations
- Updated sidebar to expose Barangays to LGU admins under the Areas menu
- Updated frontend UI to hide the City selection dropdown from LGU admins and dynamically inject their city_municipality_id
- Handled form validation issues caused by hidden required fields
- Implemented LGU dashboard routes and views
- Enforced 2 free QR code allocations on resident signup
2026-07-07 00:36:04 +08:00

33 lines
999 B
PHP

<?php
namespace App\Http\Controllers\Api\V1\Admin;
use App\Http\Controllers\Api\V1\ApiController;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class AdminTenantController extends ApiController
{
public function show(Request $request): JsonResponse
{
$tenant = $request->user()->tenant;
if (! $tenant) {
return $this->fail('Tenant not found', [], 404);
}
// We can just return the tenant data
return $this->ok([
'id' => $tenant->id,
'uuid' => $tenant->uuid,
'name' => $tenant->name,
'code' => $tenant->code,
'city_municipality_id' => $tenant->city_municipality_id,
'boundary_polygon' => $tenant->boundary_polygon ? $tenant->boundary_polygon->toArray() : null,
'logo_path' => $tenant->logo_path,
'contact_email' => $tenant->contact_email,
'contact_phone' => $tenant->contact_phone,
]);
}
}