@extends('layouts.dashboard') @section('content') @php use App\Models\Reservation; /** @var iterable $list @var string $date @var string $q @var array $tableLabels @var array $labels */ $tableLabels = $tableLabels ?? []; $labels = $labels ?? []; // Occasion id => row (for list pills) and the active set (for the legend / dropdowns). $labelMap = []; $activeLabels = []; foreach ($labels as $lbl) { $labelMap[(int) $lbl['id']] = $lbl; if ((int) ($lbl['is_active'] ?? 1) === 1) { $activeLabels[] = $lbl; } } // Friendly date for the empty state / chips (e.g. "Jun 26, 2026"). $dateLabel = fmt_day($date); // Action button labels keyed by the target status. $actionLabels = ['confirmed' => t_raw('vendor.reservations.action_confirm'), 'seated' => t_raw('vendor.reservations.action_seat'), 'completed' => t_raw('vendor.reservations.action_complete'), 'cancelled' => t_raw('common.cancel'), 'no_show' => t_raw('vendor.reservations.action_no_show'), 'waitlisted' => t_raw('vendor.reservations.action_waitlist')]; // Status changes that should ask for confirmation first. $destructive = ['cancelled', 'no_show']; // Configuring occasions and closed dates is a management-level setting, not a host // task. The controller already blocks other roles (requireManagement); we also hide the // controls here so host staff aren't shown actions they cannot perform. $isManagement = \App\Support\Auth::can('reservations.manage'); // Is the day's list narrowed by anything? Drives the Reset link's state and the empty // state below, which otherwise announces "nothing is booked for this day" on a day // that has bookings sitting outside the narrowed set. $hasFilters = $q !== '' || ($filters['status'] ?? '') !== '' || ($filters['source'] ?? '') !== '' || (int) ($filters['occasion'] ?? 0) > 0; // Carry the active date + search + status / source / occasion onto the export link. $qs = http_build_query(array_filter([ 'date' => $date, 'status' => $filters['status'] ?? '', 'source' => $filters['source'] ?? '', 'occasion' => (int) ($filters['occasion'] ?? 0), 'q' => $q, ], static fn ($v) => (string) $v !== '' && (string) $v !== '0')); @endphp @php /* .qm-d2: the dashboard density standard (app.css §35) */ @endphp
{{ t_raw('vendor.reservations.subtitle') }}
{{ t_raw('vendor.reservations.empty_filtered') }}
{{ t_raw('common.reset') }} @else{{ t_raw('vendor.reservations.empty_text') }}
{{ t_raw('vendor.reservations.add_reservation_btn') }} @endif| {{ t_raw('vendor.reservations.col_booking') }} | {{ t_raw('common.time') }} | {{ t_raw('vendor.reservations.col_guest') }} | {{ t_raw('vendor.reservations.party_label') }} | {{ t_raw('vendor.reservations.table_label') }} | {{ t_raw('vendor.reservations.col_source') }} | {{ t_raw('common.note') }} | {{ t_raw('common.status') }} | {{ t_raw('common.actions') }} |
|---|---|---|---|---|---|---|---|---|
| @if ($canEdit)#{{ $rid }}@else#{{ $rid }}@endif | {!! fmt_clock($r['reserved_at']) !!} |
{!! brandmark_html($r['avatar'] ?? null, $rName, 'md', 'qm-brandmark--round') !!}
{{ $rName }}
@php
$lid = (int) ($r['label_id'] ?? 0);
@endphp
@if ($lid && isset($labelMap[$lid]))
{{ $labelMap[$lid]['name'] }}
@endif
@if (!empty($r['guest_phone'])){{ $r['guest_phone'] }}@endif
@if (!empty($r['guest_email'])){{ $r['guest_email'] }}@endif
@php /* M46. notified_at is the guard that stops a second "your table is
ready"; showing it is how a host answers "was that guest told?"
without opening the SMS log. Same line as the two above. */
@endphp
@if (!empty($r['notified_at'])){!! t_raw('vendor.reservations.notified_at', [':time' => fmt_clock($r['notified_at'])]) !!}@endif
|
{{ (int) $r['party_size'] }} | {!! or_dash($tableId ? ($tableLabels[$tableId] ?? null) : null) !!} | @php $srcKey = (string) ($r['source'] ?? 'staff'); @endphp{{ Reservation::sourceLabel($srcKey) }} |
@if (!empty($r['special_requests'])) {{ $r['special_requests'] }} @endif
@if (!empty($r['staff_notes'])) {{ $r['staff_notes'] }} @endif
@if (empty($r['special_requests']) && empty($r['staff_notes'])){!! dash() !!}@endif
|
{{ Reservation::statusLabel($status) }} | @php $advance = []; foreach ($transitions as $to) { $isDestructive = in_array($to, $destructive, true); $advance[] = [ 'label' => $actionLabels[$to] ?? ucfirst($to), 'icon' => $isDestructive ? 'fa-ban' : 'fa-arrow-right', 'danger' => $isDestructive, 'form' => [ 'action' => '/vendor/reservations/status', 'fields' => ['id' => $rid, 'date' => $date, 'status' => $to], 'confirm' => $isDestructive ? t_raw('vendor.reservations.confirm_status_body', [':action' => $actionLabels[$to] ?? $to]) : '', ], ]; } @endphp@partial('row-actions', ['actions' => array_merge( [$canEdit ? ['label' => t_raw('vendor.reservations.edit_aria'), 'icon' => 'fa-pen', 'href' => '/vendor/reservations/' . $rid . '/edit', 'primary' => true] : null], $advance )]) |