@extends('layouts.public') @section('content') @php /** * Public "reserve a table" booking form. * @var array $restaurant @var string $cuisineName @var array $labels @var array $closedDows * @var array $blackoutDates @var int $maxParty @var int $leadMinutes * @var array $hours @var bool $isOpen */ $labels = $labels ?? []; $cuisineName = (string) ($cuisineName ?? ''); $maxParty = (int) ($maxParty ?? 50); $leadMinutes = (int) ($leadMinutes ?? 0); $closedJson = implode(',', array_map('intval', $closedDows ?? [])); $blackoutJson = implode(',', array_map('strval', $blackoutDates ?? [])); $slug = (string) $restaurant['slug']; // Sidebar content (info/contact, mini-map) mirrors restaurant-detail.php's own // $renderInfoCard/$renderMiniMap closures exactly - same data, same markup, same // classes - just inlined here since a page-local closure can't be shared across // view files. Real per-restaurant data only, nothing fabricated. $hours = $hours ?? []; $isOpen = (bool) ($isOpen ?? true); $radius = (float) ($restaurant['delivery_radius'] ?? 0); $dayNames = [t('common.day_sunday'), t('common.day_monday'), t('common.day_tuesday'), t('common.day_wednesday'), t('common.day_thursday'), t('common.day_friday'), t('common.day_saturday')]; $todayIdx = (int) date('w'); $mapLive = setting('maps_enabled', '1') === '1' && ($restaurant['lat'] ?? null) !== null && ($restaurant['lng'] ?? null) !== null; // Only a signed-in customer has an account dashboard to track the booking in (the // controller keys the success copy off the same Auth::is('customer') check). Guests // are reached only by phone/email, so we must not promise them an account view. $resvSignedIn = \App\Support\Auth::is('customer'); $rating = (float) ($restaurant['rating_cache'] ?? 0); $ratingCount = (int) ($restaurant['rating_count'] ?? 0); // Cover chain matches restaurant-detail.php exactly: the restaurant's own cover, else the // admin's configured general fallback (Settings -> General), else a clean branded banner — // never a stock photo standing in for a specific restaurant. $hasCover = !empty($restaurant['cover_image']) && is_file(public_path() . '/' . ltrim((string) $restaurant['cover_image'], '/')); $adminFallbackCover = trim((string) setting('fallback_general_image', 'assets/admin/fallback/general-fallback.png')); $hasAdminFallbackCover = $adminFallbackCover !== '' && is_file(public_path() . '/' . ltrim($adminFallbackCover, '/')); $cover = $hasCover ? media($restaurant['cover_image']) : ($hasAdminFallbackCover ? asset($adminFallbackCover) : ''); $hasAnyCover = $hasCover || $hasAdminFallbackCover; @endphp

{{ t_raw('reservation.title') }}

@php /* The page's messages belong UNDER its title band, inside the page the reader is looking at — not floating above it. getFlashes() consumes, so the layout's own call further out finds nothing and does not draw it twice. */ @endphp
@partial('flash')
{!! restaurant_logo_html($restaurant, 'xl', 'qm-rd-hero-logo') !!}

{{ $restaurant['name'] }}

@if (!empty($restaurant['address']))

{{ $restaurant['address'] }}

@endif
@if ($ratingCount > 0){{ number_format($rating, 1) }} ({{ $ratingCount }})@else{{ t_raw('restaurant.no_ratings_yet') }}@endif @if ($cuisineName) {{ $cuisineName }}@endif
{{ t_raw('nav.reservations') }}

{{ t_raw('reservation.intro') }}

@csrf

{{ t_raw('vendor.reservations.section_guest_details') }}

{{ t_raw('vendor.reservations.section_booking_details') }}

@if ($leadMinutes > 0){{ t_raw('reservation.lead_hint', [':min' => $leadMinutes]) }}@endif
@if ($labels)
@endif
{!! \App\Services\Recaptcha::widget('reservation') !!}
{!! $resvSignedIn ? t('reservation.confirm_account') : t('reservation.confirm_guest') !!} {{ t_raw('reservation.back_to_menu') }}
@endsection