@extends('layouts.public') @section('content') @php /** * Customer-facing dine-in QR scan-to-order menu. * * Reached by scanning a table QR (/table/{qr_token}); the controller has already * bound the cart to this table's restaurant. We render the SAME menu markup a * /restaurant/{slug} page uses (cards/food-item + the item-modal partial) so the * existing add-to-cart modal + cart JS work unchanged. A sticky bar surfaces the * live cart count and a "View cart & checkout" button. * * @var array $restaurant * @var string $tableLabel * @var string $cuisineName * @var array $categories * @var array $itemsByCat * @var array $optionsByItem * @var array $ingredientsByItem * @var array $hours */ $rid = (int) $restaurant['id']; $cover = media($restaurant['cover_image'], 'assets/client/covers/shop-1.png'); $rating = (float) $restaurant['rating_cache']; $ratingCount = (int) ($restaurant['rating_count'] ?? 0); $optionsByItem = $optionsByItem ?? []; $ingredientsByItem = $ingredientsByItem ?? []; $hours = $hours ?? []; // menu_only QR tables render the menu with no ordering affordances (no add buttons, no // cart bar, no item modal); order / order_pay leave the full scan-to-order flow intact. $ordering = $ordering ?? true; // "Open today" hint from opening hours, using the local day index (0=Sun..6=Sat). $todayIdx = (int) date('w'); $todayRow = $hours[$todayIdx] ?? null; $openText = ''; if ($todayRow) { if ((int) $todayRow['is_closed'] === 1) { $openText = t_raw('restaurant.closed_today'); } elseif (!empty($todayRow['open_time']) && !empty($todayRow['close_time'])) { $openText = t_raw('restaurant.open_today_hours', [ ':from' => fmt_clock($todayRow['open_time'], true), ':to' => fmt_clock($todayRow['close_time'], true), ]); } } // Address line for the banner sub-text. $addr = trim(($restaurant['address'] ?? '') . (!empty($restaurant['city']) ? ', ' . $restaurant['city'] : ''), ', '); @endphp