@extends('layouts.app') @section('content')

Booking Details

{{ $booking->booking_reference }}

Back to Bookings Calendar @if($booking->status === 'pending') @endif
Booking Information
{{ $booking->booking_reference }}
@php $statusClass = match($booking->status) { 'pending' => 'warning', 'confirmed' => 'success', 'cancelled' => 'danger', 'completed' => 'primary', default => 'secondary' }; @endphp {{ ucfirst($booking->status) }}
{{ $booking->start_datetime->format('l, F j, Y') }}
{{ $booking->start_datetime->format('g:i A') }}
{{ $booking->end_datetime->format('l, F j, Y') }}
{{ $booking->end_datetime->format('g:i A') }}
@php $days = ceil($booking->start_datetime->diffInDays($booking->end_datetime)); @endphp
{{ $days }} {{ Str::plural('day', $days) }}
{{ $booking->participants }} {{ Str::plural('participant', $booking->participants) }}
@if($booking->special_requests)
{{ $booking->special_requests }}
@endif
@if($relatedBookings->count() > 0)
Related Booking Slots {{ $relatedBookings->count() + 1 }} Total Slots

This booking is part of a group booking made with subscription credits.

{{-- Current booking --}} {{-- Other slots --}} @foreach($relatedBookings as $index => $slot) @endforeach
Slot # Date & Time Duration Status Action
Current
{{ $booking->start_datetime->format('M d, Y') }}
{{ $booking->start_datetime->format('g:i A') }} - {{ $booking->end_datetime->format('g:i A') }}
{{ $booking->start_datetime->diffInMinutes($booking->end_datetime) }} min {{ ucfirst($booking->status) }} Viewing now
Slot {{ $index + 1 }}
{{ $slot->start_datetime->format('M d, Y') }}
{{ $slot->start_datetime->format('g:i A') }} - {{ $slot->end_datetime->format('g:i A') }}
{{ $slot->start_datetime->diffInMinutes($slot->end_datetime) }} min {{ ucfirst($slot->status) }} View
@endif @if($booking->resource)
{{ $booking->resource_type ? ucfirst($booking->resource_type) : 'Property' }} Details
{{ $booking->resource->name }}
{{ ucfirst($booking->resource->resource_type ?? $booking->resource->type ?? 'N/A') }}
@if($booking->resource->description)
{{ $booking->resource->description }}
@endif
@endif
Customer Information
{{ $booking->customer_name }}
@if($booking->customer_phone) @endif
{{ $booking->created_at->format('M j, Y g:i A') }}
Payment Information
@if($booking->subscription_id && $booking->total_price == 0) {{-- Subscription Credits Payment --}}
Paid with Subscription Credits
@if($booking->subscription)
{{ $booking->subscription->package->name ?? 'N/A' }}
@endif
1 Credit
@else {{-- Regular Payment --}}
RM {{ number_format($booking->total_price, 2) }}
@endif
@php $paymentStatusClass = match($booking->payment_status) { 'pending' => 'warning', 'paid' => 'success', 'failed' => 'danger', 'refunded' => 'info', default => 'secondary' }; @endphp {{ ucfirst($booking->payment_status) }}
@php $paymentMethod = $booking->order->payment_method ?? $booking->booking_metadata['payment_method'] ?? null; @endphp @if($paymentMethod)
@if($paymentMethod === 'wallet') Wallet Credits @elseif($paymentMethod === 'stripe') Stripe @elseif($paymentMethod === 'paypal') PayPal @elseif($paymentMethod === 'chipin') ChipIn @elseif($paymentMethod === 'bank_transfer') Bank Transfer @elseif($paymentMethod === 'cash_on_delivery') Cash on Delivery @else {{ ucfirst(str_replace('_', ' ', $paymentMethod)) }} @endif
@endif @if($booking->amount_paid > 0)
RM {{ number_format($booking->amount_paid, 2) }}
@endif @if($booking->total_price > $booking->amount_paid)
RM {{ number_format($booking->total_price - $booking->amount_paid, 2) }}
@endif @if($booking->order) @endif
@if($booking->confirmed_at || $booking->cancelled_at || $booking->completed_at)
Timeline
Booking Created
{{ $booking->created_at->format('M j, Y g:i A') }}
@if($booking->confirmed_at)
Booking Confirmed
{{ $booking->confirmed_at->format('M j, Y g:i A') }}
@endif @if($booking->cancelled_at)
Booking Cancelled
{{ $booking->cancelled_at->format('M j, Y g:i A') }}
@endif @if($booking->completed_at)
Booking Completed
{{ $booking->completed_at->format('M j, Y g:i A') }}
@endif
@endif
@endsection