{{ $session->fitnessClass->name }}

{{ \Carbon\Carbon::parse($session->scheduled_at)->format('l, M j, Y · g:i A') }}

{{-- Session header --}}

Trainer

{{ $session->trainer?->name ?? $session->fitnessClass->trainer?->name ?? '—' }}

Duration

{{ $session->fitnessClass->duration_minutes ?? '—' }} min

Status

@php $sessStatusColor = match($session->status ?? 'scheduled') { 'scheduled' => 'bg-blue-100 text-blue-700', 'completed' => 'bg-green-100 text-green-700', 'cancelled' => 'bg-red-100 text-red-500', default => 'bg-gray-100 text-gray-500', }; @endphp {{ $session->status ?? 'scheduled' }}

Capacity

@php $confirmed = $session->bookings->where('status', 'confirmed')->count(); $capacity = $session->fitnessClass->capacity ?? 0; $pct = $capacity ? min(100, round($confirmed / $capacity * 100)) : 0; @endphp

{{ $confirmed }} / {{ $capacity ?: '∞' }}

@if($capacity)
@endif
{{-- Add booking --}}

Add Booking

{{-- Bookings tables --}} @foreach([['confirmed','Confirmed','green'], ['waitlisted','Waitlist','yellow'], ['cancelled','Cancelled','red']] as [$statusKey, $statusLabel, $color]) @php $group = $session->bookings->where('status', $statusKey); @endphp

{{ $statusLabel }}

{{ $group->count() }}
@if($group->isEmpty())
No {{ strtolower($statusLabel) }} bookings.
@else
@foreach($group as $booking) @endforeach
Member Booked At
{{ strtoupper(substr($booking->member?->name ?? '?', 0, 1)) }}

{{ $booking->member?->name }}

{{ $booking->member?->member_id }}

{{ \Carbon\Carbon::parse($booking->created_at)->format('M j, g:i A') }}
@if($statusKey === 'confirmed')
@csrf @method('PATCH')
@endif @if($statusKey !== 'cancelled')
@csrf @method('PATCH')
@endif
@endif
@endforeach {{-- Cancel session --}} @if(($session->status ?? 'scheduled') === 'scheduled')
@csrf @method('PATCH')
@endif