From 3cae32b236b46ff2cf3e99a43421a92cdf6f4611 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 27 Apr 2023 17:13:09 -0700 Subject: [PATCH] Eager load default locations --- app/Http/Controllers/Api/AssetMaintenancesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/AssetMaintenancesController.php b/app/Http/Controllers/Api/AssetMaintenancesController.php index ab5635ec33..b2870792f9 100644 --- a/app/Http/Controllers/Api/AssetMaintenancesController.php +++ b/app/Http/Controllers/Api/AssetMaintenancesController.php @@ -36,7 +36,7 @@ class AssetMaintenancesController extends Controller { $this->authorize('view', Asset::class); - $maintenances = AssetMaintenance::select('asset_maintenances.*')->with('asset', 'asset.model', 'asset.location', 'supplier', 'asset.company', 'admin'); + $maintenances = AssetMaintenance::select('asset_maintenances.*')->with('asset', 'asset.model', 'asset.location', 'asset.defaultLoc', 'supplier', 'asset.company', 'admin'); if ($request->filled('search')) { $maintenances = $maintenances->TextSearch($request->input('search'));