{{-- resources/views/reservations/index.blade.php --}} @extends('layouts.app') @section('title', 'Reservations') @section('page_title', 'Reservations') @section('page_subtitle', 'All reservations') @section('content') {{-- Filters --}}
@if(request()->hasAny(['search','status','date_from','date_to'])) Clear @endif
{{-- Table --}}
Reservations {{ $reservations->total() }} total
@if($reservations->isEmpty())

No reservations found

Create First Reservation
@else
@foreach($reservations as $res) @php $statusColors = [ 'tentative' => ['bg'=>'#fef3c7','color'=>'#92400e'], 'confirmed' => ['bg'=>'#dbeafe','color'=>'#1e40af'], 'checked_in' => ['bg'=>'#d1fae5','color'=>'#065f46'], 'checked_out' => ['bg'=>'#f1f5f9','color'=>'#475569'], 'cancelled' => ['bg'=>'#fee2e2','color'=>'#991b1b'], 'no_show' => ['bg'=>'#fee2e2','color'=>'#991b1b'], ]; $sc = $statusColors[$res->status] ?? $statusColors['confirmed']; @endphp @endforeach
Reference Guest Rooms Check In Check Out Nights Amount Balance Status
{{ $res->reference }}
{{ $res->guest?->first_name }} {{ $res->guest?->last_name }}
{{ $res->adults }} adult{{ $res->adults > 1 ? 's' : '' }} @if($res->children > 0) · {{ $res->children }} child @endif
@foreach($res->rooms as $rr) Room {{ $rr->room?->number }}@if(!$loop->last), @endif @endforeach {{ $res->check_in_date->format('d M Y') }} {{ $res->check_out_date->format('d M Y') }} {{ $res->nights }} {{ $res->currency }} {{ number_format($res->total_amount, 2) }} @if($res->balance_due > 0) {{ $res->currency }} {{ number_format($res->balance_due, 2) }} @else Paid @endif {{ str_replace('_', ' ', $res->status) }} View →
@if($reservations->hasPages())
{{ $reservations->links() }}
@endif @endif
@endsection