@php // Items store a plain path slug in `url` or `route` (not a registered // Laravel route name), so build hrefs the same way the rest of the site // does rather than using MenuItem::link(). $sidebarMenuHref = function ($item) { $path = $item->url ?: $item->route; return $path ? url(rtrim($path, '/') . '/') : '#'; }; @endphp @foreach ($items as $item) @if ($item->children->count())
@else @endif @endforeach