@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
  • {{ $title }} @if($children) @endif