@extends('layouts.dashboard') @section('content') @php /** @var array|null $restaurant @var array $cuisines @var array $zones @var array $hours */ $r = $restaurant ?? []; $cuisines = $cuisines ?? []; $zones = $zones ?? []; $hours = $hours ?? []; $layoutVal = in_array($r['detail_layout'] ?? 'classic', ['classic', 'style1', 'style2'], true) ? ($r['detail_layout'] ?? 'classic') : 'classic'; $dayKeys = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']; // Money policy carries its own privileges — the controller refuses the POST; this hides // each tab so nobody is shown a form that would be rejected. Granted separately, because // a role may well be trusted with the loyalty programme but not with tax rates. $canTax = $canTax ?? \App\Support\Auth::can('settings.tax'); $canLoyalty = $canLoyalty ?? \App\Support\Auth::can('settings.loyalty'); // Delivery is the platform operator's decision, so the two tabs that exist only to configure it // are gone when it is off — same reasoning as the two above: never show a form whose POST the // controller will refuse. Read once here so the tab button and its panel cannot disagree. $canDeliver = \App\Services\Capability::has(\App\Services\Capability::DELIVERY); $ordersPaused = (bool) ($ordersPaused ?? false); // The auto-resume field wants the restaurant's own local wall-clock time. $pauseUntil = trim((string) ($r['orders_paused_until'] ?? '')); if ($pauseUntil !== '') { try { $pauseUntil = (new DateTimeImmutable($pauseUntil, restaurant_tz($r)))->format('Y-m-d\TH:i'); } catch (Throwable $e) { $pauseUntil = ''; } } @endphp @php /* .qm-d2: the dashboard density standard (app.css §35) */ @endphp