@php $children = array_values((array) data_get($item, 'children', [])); $url = trim((string) data_get($item, 'url', '#')) ?: '#'; $title = trim((string) data_get($item, 'title', 'Menu')) ?: 'Menu'; $target = in_array(data_get($item, 'target'), ['_self', '_blank'], true) ? data_get($item, 'target') : '_self'; $normalizedUrl = $url === '#' ? '#' : rtrim($url, '/'); $active = $normalizedUrl !== '#' && $normalizedUrl === $currentUrl; @endphp @if(($level ?? 0) === 0)
  • {{ $title }} @if($children)@endif @if($children)
    @endif
  • @else
  • {{ $title }} @if($children) @endif
  • @endif