From 7fb6384860c8a0ae43870fcf86fb2066b025ec15 Mon Sep 17 00:00:00 2001 From: Adrien Poupa Date: Thu, 6 Dec 2018 23:24:41 -0500 Subject: [PATCH] Eager load group on the dashboard/components page not to query twice --- app/Http/Controllers/Dashboard/ComponentController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Dashboard/ComponentController.php b/app/Http/Controllers/Dashboard/ComponentController.php index 2745cf4b..152e345d 100644 --- a/app/Http/Controllers/Dashboard/ComponentController.php +++ b/app/Http/Controllers/Dashboard/ComponentController.php @@ -73,7 +73,7 @@ class ComponentController extends Controller */ public function showComponents() { - $components = Component::orderBy('order')->orderBy('created_at')->get(); + $components = Component::with('group')->orderBy('order')->orderBy('created_at')->get(); $this->subMenu['components']['active'] = true;