diff --git a/app/Http/Controllers/DivisiController.php b/app/Http/Controllers/DivisiController.php index 7ef14d3..e398682 100644 --- a/app/Http/Controllers/DivisiController.php +++ b/app/Http/Controllers/DivisiController.php @@ -92,7 +92,7 @@ class DivisiController extends Controller public function list() { - $parentMenus = Divisi::with('children')->whereNull('parent')->get(); + $parentMenus = Divisi::whereNull('parent')->with('children')->get(); $divisions = []; foreach($parentMenus as $menu){ $childs = $this->getAllChildren($menu);