@php // Items store a plain path slug in `url` or `route` (not a registered // Laravel route name); url() passes absolute URLs (like the Newsletters // item's substack link) through unchanged, so this works for both. $menuItemHref = function ($item) { $path = $item->url ?: $item->route; return $path ? url(rtrim($path, '/') . '/') : '#'; }; @endphp @foreach ($items as $item)
  • target ?: '_self') === '_blank') rel="noopener noreferrer" @endif>{{ $item->title }}
  • @endforeach