@extends('layouts.admin', [ 'title' => 'Appointment Calendar', 'pageTitle' => 'Appointment Calendar', 'active' => 'calendar', ]) @php $statusVariants = [ 'pending' => 'warning', 'confirmed' => 'primary', 'checked_in' => 'purple', 'completed' => 'success', 'cancelled' => 'danger', 'no_show' => 'muted', ]; $blockClasses = [ 'pending' => 'border-amber-200 bg-amber-50/95 text-amber-800', 'confirmed' => 'border-blue-200 bg-blue-50/95 text-blue-800', 'checked_in' => 'border-violet-200 bg-violet-50/95 text-violet-800', 'completed' => 'border-emerald-200 bg-emerald-50/95 text-emerald-800', 'cancelled' => 'border-red-200 bg-red-50/95 text-red-700', 'no_show' => 'border-slate-200 bg-slate-50/95 text-slate-700', ]; $columnCount = max(1, $staffProfiles->count()); $startHour = min($calendarHours); $endHour = max($calendarHours); $dayStart = $selectedDate->copy()->setTime($startHour, 0); $previousDate = $selectedDate->copy()->subDay()->toDateString(); $nextDate = $selectedDate->copy()->addDay()->toDateString(); @endphp @section('content')

Review staff availability, time slots, and daily appointment flow.

List View New Appointment
@if (session('status'))
{{ session('status') }}
@endif
{{ $selectedDate->format('M d, Y') }}
Filter
@forelse ($staffProfiles as $member)
{{ $member->initials }}
{{ $member->name }}
@empty
No staff
@endforelse
@foreach ($calendarHours as $hour)
{{ \Illuminate\Support\Carbon::createFromTime($hour)->format('g A') }}
@foreach ($staffProfiles as $member)
@endforeach @endforeach @foreach ($appointments as $item) @php $staffIndex = $staffProfiles->values()->search(fn ($member) => (int) $member->id === (int) $item->staff_profile_id); $minutesFromStart = $item->starts_at->diffInMinutes($dayStart, false) * -1; $top = max(0, $minutesFromStart * (62 / 60)); $height = max(44, $item->duration_minutes * (62 / 60)); @endphp @if ($staffIndex !== false && $item->starts_at->hour <= $endHour)

{{ $item->service?->name ?? 'Service removed' }}

{{ $item->starts_at->format('g:i A') }} - {{ $item->ends_at->format('g:i A') }}

{{ $item->customer?->name ?? 'Customer removed' }}

@endif @endforeach
@forelse ($appointments as $item)
{{ $item->customer?->initials ?? 'CU' }}

{{ $item->customer?->name ?? 'Customer removed' }}

{{ $item->service?->name ?? 'Service removed' }}

{{ $item->status_label }}
{{ $item->starts_at->format('g:i A') }}
@empty
No appointments for this day.
@endforelse
Confirmed
Checked In
Pending
Completed
@push('modals') @include('admin.appointments.partials.create-modal', ['modalAppointment' => null, 'mode' => 'create', 'modalId' => 'create-appointment-modal']) @foreach ($appointments as $item) @include('admin.appointments.partials.status-modal', ['modalAppointment' => $item, 'modalId' => 'status-appointment-modal-' . $item->id]) @endforeach @endpush @endsection