Deploy Ladill Queue / deploy (push) Successful in 36s
Introduce shared x-qms.page-hero with summary stats across queues, tickets, counters, admin pages, and insights; remove bordered cards on Analytics, Reports, Feedback, and Branches list views. Co-authored-by: Cursor <cursoragent@cursor.com>
86 lines
4.7 KiB
PHP
86 lines
4.7 KiB
PHP
@php
|
|
$canIssueTickets = app(\App\Services\Qms\QmsPermissions::class)->can(
|
|
app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()),
|
|
'tickets.issue'
|
|
);
|
|
@endphp
|
|
|
|
<x-app-layout title="Tickets">
|
|
<div class="space-y-6">
|
|
<x-qms.page-hero
|
|
badge="Live · Historical · All service lines"
|
|
title="Tickets"
|
|
description="Live and historical queue tickets across all service lines — filter by queue, status, or issue new walk-in tickets."
|
|
:stats="[
|
|
['value' => number_format($heroStats['today']), 'label' => 'Issued today'],
|
|
['value' => number_format($heroStats['waiting']), 'label' => 'Waiting'],
|
|
['value' => number_format($heroStats['serving']), 'label' => 'Being served'],
|
|
]">
|
|
@if ($canIssueTickets)
|
|
<x-slot name="actions">
|
|
<a href="{{ route('qms.tickets.create') }}" class="btn-primary">Issue ticket</a>
|
|
</x-slot>
|
|
@endif
|
|
</x-qms.page-hero>
|
|
|
|
<form method="GET" class="flex flex-wrap items-end gap-3 rounded-2xl border border-slate-200 bg-white p-4">
|
|
<div>
|
|
<label class="block text-xs font-medium uppercase tracking-wide text-slate-500">Queue</label>
|
|
<select name="queue" class="mt-1 rounded-lg border-slate-300 text-sm">
|
|
<option value="">All queues</option>
|
|
@foreach ($queues as $queue)
|
|
<option value="{{ $queue->uuid }}" @selected(request('queue') === $queue->uuid)>{{ $queue->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium uppercase tracking-wide text-slate-500">Status</label>
|
|
<select name="status" class="mt-1 rounded-lg border-slate-300 text-sm">
|
|
<option value="">All statuses</option>
|
|
@foreach (config('qms.ticket_statuses') as $value => $label)
|
|
<option value="{{ $value }}" @selected(request('status') === $value)>{{ $label }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<button type="submit" class="btn-secondary text-sm">Filter</button>
|
|
@if (request()->hasAny(['queue', 'status']))
|
|
<a href="{{ route('qms.tickets.index') }}" class="text-sm text-slate-500 hover:text-slate-700">Clear</a>
|
|
@endif
|
|
</form>
|
|
|
|
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
|
|
@if ($tickets->isEmpty())
|
|
<x-empty-state title="No tickets match your filters" description="Issue a walk-in ticket or adjust filters to see results." />
|
|
@else
|
|
<table class="min-w-full divide-y divide-slate-100 text-sm">
|
|
<thead class="bg-slate-50 text-left text-xs uppercase tracking-wide text-slate-500">
|
|
<tr>
|
|
<th class="px-4 py-3">Ticket</th>
|
|
<th class="px-4 py-3">Customer</th>
|
|
<th class="px-4 py-3">Queue</th>
|
|
<th class="px-4 py-3">Counter</th>
|
|
<th class="px-4 py-3">Status</th>
|
|
<th class="px-4 py-3">Issued</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-slate-50">
|
|
@foreach ($tickets as $ticket)
|
|
<tr class="hover:bg-slate-50/80">
|
|
<td class="px-4 py-3">
|
|
<a href="{{ route('qms.tickets.show', $ticket) }}" class="font-mono text-base font-semibold text-indigo-700 hover:underline">{{ $ticket->ticket_number }}</a>
|
|
</td>
|
|
<td class="px-4 py-3 text-slate-700">{{ $ticket->customer_name ?: 'Walk-in' }}</td>
|
|
<td class="px-4 py-3 text-slate-600">{{ $ticket->serviceQueue?->name }}</td>
|
|
<td class="px-4 py-3 text-slate-600">{{ $ticket->counter?->name ?? '—' }}</td>
|
|
<td class="px-4 py-3"><x-ticket-status :status="$ticket->status" /></td>
|
|
<td class="px-4 py-3 text-slate-500">{{ $ticket->issued_at?->format('M j, H:i') }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
<div class="border-t border-slate-200 px-4 py-3">{{ $tickets->links() }}</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|