@foreach ($menus as $menu) @php $has_child = $menu->childsActive->isNotEmpty(); $params = $menu->route_params ? json_decode($menu->route_params, true) : []; $menu_url = !empty($menu->route) ? route($menu->route, $params) : '#'; $link_target = !empty($menu->link_target) ? $menu->link_target : '_self'; $menu_id = 'topnav-'. str_replace(' ', '_', $menu->name) .'_'.$menu->id; @endphp @can($menu->permission)
  • {{ $menu->name }} @if ($has_child)
    @endif
    @if ($has_child)
    @foreach ($menu->childsActive as $child) @php $has_sub_child = $child->childsActive->isNotEmpty(); $params = $child->route_params ? json_decode($child->route_params, true) : []; $child_menu_url = !empty($child->route) ? route($child->route, $params) : '#'; $child_link_target = !empty($child->link_target) ? $child->link_target : '_self'; $child_menu_id = 'topnav-'. str_replace(' ', '_', $child->name) .'_'.$child->id; @endphp @can($child->permission) @if (!$has_sub_child) @if ($child->before_separator)
    @endif {{ $child->name }} @if ($child->after_separator)
    @endif @else
    @if ($child->before_separator)
    @endif {{ $child->name }}
    @foreach ($child->childsActive as $sub_child) @php $params = $sub_child->route_params ? json_decode($sub_child->route_params, true) : []; $sub_child_menu_url = !empty($sub_child->route) ? route($sub_child->route, $params) : '#'; $sub_child_link_target = !empty($sub_child->link_target) ? $sub_child->link_target : '_self'; @endphp @can($sub_child->permission) @if ($sub_child->before_separator)
    @endif @if (!empty($sub_child->child_icon) && $sub_child->child_icon_position == 'start')@endif {{ $sub_child->name }} @if (!empty($sub_child->child_icon) && $sub_child->child_icon_position == 'end') @endif @if ($sub_child->after_separator)
    @endif @endcan @endforeach
    @if ($child->after_separator)
    @endif
    @endif @endcan @endforeach
    @endif
  • @endcan @endforeach