@if(!$restaurant->enable_customer_reservation)
@lang('modules.reservation.reservationsDisabled')
@lang('modules.reservation.reservationsDisabledDescription')
@else
@lang('messages.frontReservationHeading')
@lang('messages.selectBookingDetail')
{{-- Date Selection --}}
@php $dateFormat = $restaurant->date_format ?? 'd-m-Y'; $minDate = now()->timezone(timezone())->format($dateFormat); $maxDate = now()->timezone(timezone())->addDays(6)->format($dateFormat); @endphp
@error('date')
{{ $message }}
@enderror
{{-- Guest Selection --}}
{{ $numberOfGuests }} @lang('modules.reservation.guests')
@for ($i = 1; $i <= 30; $i++)
{{ $i }} @lang('modules.reservation.guests')
@endfor
@error('numberOfGuests')
{{ $message }}
@enderror
{{-- Slot Type Selection --}}
@lang('modules.reservation.' . $slotType)
@php $slotTypes = \App\Livewire\Shop\BookATable::SLOT_TYPES; $selectedDay = 'Unknown'; try { if (!empty($date) && strtotime($date)) { $selectedDay = \Carbon\Carbon::parse($date)->format('l'); } } catch (\Exception $e) { $selectedDay = 'Unknown'; } @endphp @foreach($slotTypes as $type) @php $isSlotTypeDisabled = !isset($availableSlotTypes[$type]) || !in_array($selectedDay, $availableSlotTypes[$type] ?? []); @endphp
$isSlotTypeDisabled ])> @lang('modules.reservation.' . $type)
@endforeach
{{-- Time Slots --}}
@lang('messages.selectTimeSlot')
@if (empty($timeSlots) || !$this->isSlotTypeAvailable())
@lang('messages.noTimeSlot')
@endif
@foreach ($timeSlots as $timeSlot) @php $isDisabled = $this->isTimeSlotDisabled($timeSlot); @endphp
$isDisabled, 'cursor-pointer hover:text-gray-600 hover:bg-gray-50 dark:hover:text-gray-300 dark:hover:bg-gray-700' => !$isDisabled ]) >
@php $safeTime = '--'; try { if (!empty($timeSlot)) { // Get time format from restaurant or use default $timeFormat = $restaurant->time_format ?? 'h:i A'; // Parse time slot from H:i:s format (database format) $timeObj = \Carbon\Carbon::createFromFormat('H:i:s', $timeSlot); $safeTime = $timeObj->translatedFormat($timeFormat); } } catch (\Exception $e) { $safeTime = 'Unknown time'; } @endphp {{ $safeTime }}
@endforeach
@error('availableTimeSlots')
{{ $message }}
@enderror
{{-- Reservation Form (only shown when slots are available) --}} @if (!empty($timeSlots) && $this->isSlotTypeAvailable())
@if (is_null(customer()))
@lang('messages.loginForReservation')
@else
@lang('app.reserveNow')
@endif
@endif
@endif