@if($empty)

No results{{ $q ? " for “{$q}”" : '' }}.

@else
@foreach([ 'products' => 'Products', 'collections' => 'Collections', 'pages' => 'Pages', 'articles' => 'Articles', ] as $key => $label) @if(! empty($results[$key]))

{{ $label }}

    @foreach($results[$key] as $item) @php $item = is_array($item) ? $item : ['title' => $item->title ?? '', 'handle' => $item->handle ?? '', 'url' => $item->url ?? null]; $url = $item['url'] ?? match ($key) { 'products' => '/products/'.($item['handle'] ?? ''), 'collections' => '/collections/'.($item['handle'] ?? ''), 'pages' => '/pages/'.($item['handle'] ?? ''), 'articles' => '/blogs/news/'.($item['handle'] ?? ''), default => '#', }; @endphp
  • {{ $item['title'] ?? 'Untitled' }}
  • @endforeach
@endif @endforeach
@endif