@php // Authentication links are rendered in the menu for the current web session. $cmsNavigation = $cmsNavigation->reject(fn ($item) => in_array( rtrim(parse_url($item->publicUrl(), PHP_URL_PATH) ?? '', '/'), ['/account', '/signin', '/signup', '/login', '/register'], true )); $navGroups = $cmsNavigation->groupBy(fn ($item) => $item->parent_id ?? 0); @endphp @foreach ($navGroups[0] ?? [] as $root) @php $label = $root->localized(null, true); $children = $navGroups[$root->id] ?? collect(); @endphp @if ($children->isEmpty()) {{ $label['menu_title'] ?: $label['title'] }} @else
{{ $label['menu_title'] ?: $label['title'] }}
{{ $label['menu_title'] ?: $label['title'] }} @php $descendants = \App\Support\PageTree::descendants($root->id, $cmsNavigation); @endphp @foreach ($cmsNavigation as $item) @if ($item->id !== $root->id && in_array($item->id, $descendants, true)) @php $itemLabel = $item->localized(null, true); @endphp {{ $itemLabel['menu_title'] ?: $itemLabel['title'] }} @endif @endforeach
@endif @endforeach @auth('web') {{ __('site.auth.profile') }} @else {{ __('site.auth.signin') }} @endauth