@extends('layouts.app') @section('title', 'Search') @section('content') @php $icons = ['staff' => 'group', 'services' => 'home_health', 'courses' => 'school', 'sessions' => 'event', 'policies' => 'description']; $groups = collect(\App\Http\Controllers\SearchController::GROUPS) ->map(fn ($label, $key) => ['label' => $label, 'icon' => $icons[$key] ?? 'search'])->all(); @endphp

Search

@if($q !== '')

{{ $total }} result{{ $total === 1 ? '' : 's' }} for “{{ $q }}”

@endif
{{-- Search box (also usable straight from this page) --}}
search
@if($q === '')
search

Type to search

Find staff, services, courses, training sessions and policies. Type part of a name — word order doesn't matter.

@elseif($total === 0)
search_off

No matches for “{{ $q }}”

Try a different word or a shorter term.

@else
@foreach($groups as $key => $meta) @php $items = $results[$key] ?? []; @endphp @if(count($items))
{{ $meta['icon'] }}

{{ $meta['label'] }}

({{ count($items) }})
@foreach($items as $item) @php $tag = $item['url'] ? 'a' : 'div'; @endphp <{{ $tag }} @if($item['url']) href="{{ $item['url'] }}" @endif class="flex items-center justify-between gap-3 px-5 py-3.5 {{ $item['url'] ? 'hover:bg-surface-container-high transition-colors' : '' }}">

{{ $item['title'] }}

@if(!empty($item['sub']))

{{ $item['sub'] }}

@endif
@if($item['url']) chevron_right @endif @endforeach
@endif @endforeach
@endif @endsection