Dashboards
@php $headingOtorisasi = 0; $headingMain = 0; $headingMaster = 0; $headingSystem = 0; // Ensure $menus is defined and is an object $menus = isset($menus) ? json_decode(json_encode($menus)) : new stdClass; // Define the order of sections $sectionOrder = ['main','otorisator', 'master', 'system']; @endphp @foreach($sectionOrder as $section) @if(!empty($menus->$section)) @if($section == 'otorisator' && $headingOtorisasi == 0)
Otorisator
@php $headingOtorisasi = 1; @endphp @elseif($section == 'main' && $headingMain == 0)
Apps
@php $headingMain = 1; @endphp @elseif($section == 'master' && $headingMaster == 0)
Master Data
@php $headingMaster = 1; @endphp @elseif($section == 'system' && $headingSystem == 0)
Systems
@php $headingSystem = 1; @endphp @endif @foreach($menus->$section as $menu) @if(auth()->user()->hasRole($menu->roles)) @if(isset($menu->sub))
{{ $menu->title }}
@if(is_array($menu->sub))
@foreach($menu->sub as $sub) @if(auth()->user()->hasRole($sub->roles))
{{ $sub->title }}
@endif @endforeach
@endif
@else
{{ $menu->title }}
@endif @endif @endforeach @endif @endforeach