diff --git a/app/controller/LocationController.php b/app/controller/LocationController.php index ca06aca..dac3aaa 100644 --- a/app/controller/LocationController.php +++ b/app/controller/LocationController.php @@ -19,6 +19,7 @@ class LocationController ->map(function ($location) { $location->vehicle_count = $location->vehicles->count(); $location->fbo_vehicle_count = $location->fboVehicles->count(); + $location->count = ($location->vehicle_count > 0) ? $location->vehicle_count : $location->fbo_vehicle_count; return $location; }); return Util::success($locations);