@extends('crm.layouts.app') @section('title', 'Search Results') @section('content')

Search

@if($query) @endif
@if(empty($query))

Search your CRM

Find clients and appointments by name, email, phone, or notes.

@else

Found {{ $clients->count() + $appointments->count() }} results for "{{ $query }}"

@if($clients->count() > 0)

Clients ({{ $clients->count() }})

    @foreach($clients as $client)
  • {{ substr($client->name, 0, 1) }}
    {{ $client->name }}
    @if($client->email)

    {{ $client->email }}

    @endif @if($client->phone)

    {{ $client->phone }}

    @endif
    @if($client->notes)

    {{ $client->notes }}

    @endif
  • @endforeach
@endif @if($appointments->count() > 0)

Appointments ({{ $appointments->count() }})

    @foreach($appointments as $appointment)
  • {{ $appointment->client->name }} @php $statusColors = [ 'pending' => 'bg-yellow-50 text-yellow-700 ring-yellow-600/20', 'confirmed' => 'bg-blue-50 text-blue-700 ring-blue-600/20', 'completed' => 'bg-green-50 text-green-700 ring-green-600/20', 'cancelled' => 'bg-red-50 text-red-700 ring-red-600/20', ]; @endphp {{ ucfirst($appointment->status) }}
    {{ $appointment->scheduled_at->format('M d, Y g:i A') }} @if($appointment->price) ${{ number_format($appointment->price, 2) }} @endif
    @if($appointment->notes)

    {{ $appointment->notes }}

    @endif
  • @endforeach
@endif @if($clients->count() === 0 && $appointments->count() === 0)

No results found

Try a different search term or check your spelling.

@endif
@endif
@endsection