From 2f9582ee5c18213fdb81b6ae25679c984618e888 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 23 Sep 2021 17:31:19 -0700 Subject: [PATCH] Switched to loadMissing for performance Signed-off-by: snipe --- app/Http/Controllers/Api/AssetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index a4321cf0c3..57f94fa107 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -325,7 +325,7 @@ class AssetsController extends Controller * Include additional associated relationships */ if ($request->input('components')) { - $assets->load(['components' => function ($query) { + $assets->loadMissing(['components' => function ($query) { $query->orderBy('created_at', 'desc'); }]); }