@extends('layouts.app', ['title' => 'Appointments']) @php $statusClass = ['booked' => 'text-bg-primary', 'confirmed' => 'text-bg-info', 'completed' => 'text-bg-success', 'no_show' => 'text-bg-warning', 'cancelled' => 'text-bg-secondary']; $nav = fn ($d) => route('appointments.index', array_merge(request()->except('date'), ['view' => $view, 'date' => $d->toDateString()])); $step = $view === 'month' ? 'Month' : 'Week'; @endphp @section('content')

Appointments

Every booking from your calendars, with who it is assigned to.

Booking calendars
Today
{{ $counts['today'] }}
Upcoming
{{ $counts['upcoming'] }}
No-shows (30 days)
{{ $counts['no_show'] }}
@error('start')
{{ $message }}
@enderror
@foreach (['list' => 'List', 'week' => 'Week', 'month' => 'Month'] as $k => $label) {{ $label }} @endforeach
@if ($view !== 'list') {{ $view === 'month' ? $date->format('F Y') : $from->format('d M').' – '.$to->format('d M Y') }} @else @endif
@if (request('date'))@endif @can('calendars.manage')
@endcan
@if ($view === 'month')
@foreach (['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] as $d)
{{ $d }}
@endforeach @for ($day = $from; $day->lte($to); $day = $day->addDay()) @php($items = $byDay[$day->toDateString()] ?? collect())
{{ $day->day }}
@foreach ($items->take(3) as $a)
{{ $a->starts_at->timezone($tz)->format('h:i') }} {{ $a->contact?->first_name }}
@endforeach @if ($items->count() > 3)+{{ $items->count() - 3 }} more@endif
@endfor
@else @forelse ($byDay as $day => $items)

{{ \Carbon\Carbon::parse($day, $tz)->isSameDay(now($tz)) ? 'Today, ' : '' }}{{ \Carbon\Carbon::parse($day, $tz)->format('l, d F') }}

@foreach ($items as $a)
{{ $a->starts_at->timezone($tz)->format('h:i A') }}
{{ $a->starts_at->diffInMinutes($a->ends_at) }} min
@if ($a->contact){{ $a->contact->full_name }}@else Guest @endif · {{ $a->contact?->phone }}
{{ $a->calendar->name }} · {{ $a->user?->name ?? 'Unassigned' }}@if ($a->meeting_url) · Join link@endif
@if ($a->answers)
@foreach ($a->answers as $q => $ans)
{{ $q }}: {{ $ans }}
@endforeach
@endif @if ($a->cancel_reason)
Cancelled: {{ $a->cancel_reason }}
@endif
{{ \App\Models\Appointment::STATUSES[$a->status] ?? $a->status }} @if (auth()->user()->can('calendars.manage') || $a->user_id === auth()->id()) @endif
@endforeach
@empty
No appointments {{ $view === 'week' ? 'this week' : 'here yet' }}. Share a booking link to get your first one.
@endforelse @endif @endsection @push('scripts') @endpush