|
|
@ -92,7 +92,7 @@ class DivisiController extends Controller |
|
|
|
|
|
|
|
|
|
|
|
public function list() |
|
|
|
public function list() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$parentMenus = Divisi::whereNull('parent')->with('children')->get(); |
|
|
|
$parentMenus = Divisi::with('children')->whereNull('parent')->get(); |
|
|
|
$divisions = []; |
|
|
|
$divisions = []; |
|
|
|
foreach($parentMenus as $menu){ |
|
|
|
foreach($parentMenus as $menu){ |
|
|
|
$childs = $this->getAllChildren($menu); |
|
|
|
$childs = $this->getAllChildren($menu); |
|
|
|