diff --git a/app/Http/Controllers/Qms/AppointmentController.php b/app/Http/Controllers/Qms/AppointmentController.php index 3992f80..39fcb8a 100644 --- a/app/Http/Controllers/Qms/AppointmentController.php +++ b/app/Http/Controllers/Qms/AppointmentController.php @@ -38,7 +38,17 @@ class AppointmentController extends Controller ->orderBy('scheduled_at') ->paginate(30); - return view('qms.appointments.index', compact('appointments', 'organization')); + $appointmentQuery = QueueAppointment::owned($owner) + ->where('organization_id', $organization->id) + ->when($branchScope, fn ($q) => $q->where('branch_id', $branchScope)); + + $heroStats = [ + 'today' => (clone $appointmentQuery)->whereDate('scheduled_at', today())->count(), + 'scheduled' => (clone $appointmentQuery)->where('status', 'scheduled')->count(), + 'checked_in' => (clone $appointmentQuery)->where('status', 'checked_in')->count(), + ]; + + return view('qms.appointments.index', compact('appointments', 'organization', 'heroStats')); } public function create(Request $request): View diff --git a/app/Http/Controllers/Qms/BranchController.php b/app/Http/Controllers/Qms/BranchController.php index d064ebf..9ab9670 100644 --- a/app/Http/Controllers/Qms/BranchController.php +++ b/app/Http/Controllers/Qms/BranchController.php @@ -26,7 +26,13 @@ class BranchController extends Controller ->orderBy('name') ->get(); - return view('qms.admin.branches.index', compact('branches', 'organization')); + $heroStats = [ + 'total' => $branches->count(), + 'active' => $branches->where('is_active', true)->count(), + 'departments' => $branches->sum('departments_count'), + ]; + + return view('qms.admin.branches.index', compact('branches', 'organization', 'heroStats')); } public function create(Request $request): View diff --git a/app/Http/Controllers/Qms/CounterController.php b/app/Http/Controllers/Qms/CounterController.php index 6849f51..a88846b 100644 --- a/app/Http/Controllers/Qms/CounterController.php +++ b/app/Http/Controllers/Qms/CounterController.php @@ -29,7 +29,18 @@ class CounterController extends Controller ->orderBy('name') ->paginate(20); - return view('qms.counters.index', compact('counters', 'organization')); + $counterStats = Counter::owned($owner) + ->where('organization_id', $organization->id) + ->when(true, fn ($q) => $this->scopeToBranch($request, $q)) + ->get(); + + $heroStats = [ + 'total' => $counterStats->count(), + 'available' => $counterStats->where('status', 'available')->count(), + 'busy' => $counterStats->where('status', 'busy')->count(), + ]; + + return view('qms.counters.index', compact('counters', 'organization', 'heroStats')); } public function show(Request $request, Counter $counter): View diff --git a/app/Http/Controllers/Qms/DepartmentController.php b/app/Http/Controllers/Qms/DepartmentController.php index 85be0fc..7016709 100644 --- a/app/Http/Controllers/Qms/DepartmentController.php +++ b/app/Http/Controllers/Qms/DepartmentController.php @@ -27,10 +27,17 @@ class DepartmentController extends Controller ->orderBy('name') ->get(); + $heroStats = [ + 'total' => $departments->count(), + 'active' => $departments->where('is_active', true)->count(), + 'branches' => $departments->pluck('branch_id')->unique()->count(), + ]; + return view('qms.admin.departments.index', [ 'departments' => $departments, 'organization' => $organization, 'types' => config('qms.department_types'), + 'heroStats' => $heroStats, ]); } diff --git a/app/Http/Controllers/Qms/DeviceController.php b/app/Http/Controllers/Qms/DeviceController.php index 5a27543..e471549 100644 --- a/app/Http/Controllers/Qms/DeviceController.php +++ b/app/Http/Controllers/Qms/DeviceController.php @@ -38,11 +38,22 @@ class DeviceController extends Controller ->orderBy('name') ->paginate(20); + $deviceStats = Device::owned($owner) + ->where('organization_id', $organization->id) + ->get(); + + $heroStats = [ + 'total' => $deviceStats->count(), + 'online' => $deviceStats->where('status', 'online')->count(), + 'kiosks' => $deviceStats->where('type', 'kiosk')->count(), + ]; + return view('qms.devices.index', [ 'devices' => $devices, 'organization' => $organization, 'deviceTypes' => config('qms.device_types'), 'canManage' => $permissions->can($member, 'displays.manage'), + 'heroStats' => $heroStats, ]); } diff --git a/app/Http/Controllers/Qms/DisplayScreenController.php b/app/Http/Controllers/Qms/DisplayScreenController.php index 6336b92..173b0f1 100644 --- a/app/Http/Controllers/Qms/DisplayScreenController.php +++ b/app/Http/Controllers/Qms/DisplayScreenController.php @@ -33,10 +33,21 @@ class DisplayScreenController extends Controller ->orderBy('name') ->paginate(20); + $screenStats = DisplayScreen::owned($owner) + ->where('organization_id', $organization->id) + ->get(); + + $heroStats = [ + 'total' => $screenStats->count(), + 'active' => $screenStats->where('is_active', true)->count(), + 'branches' => $screenStats->pluck('branch_id')->filter()->unique()->count(), + ]; + return view('qms.displays.index', [ 'screens' => $screens, 'organization' => $organization, 'canManage' => $permissions->can($member, 'displays.manage'), + 'heroStats' => $heroStats, ]); } diff --git a/app/Http/Controllers/Qms/FeedbackAdminController.php b/app/Http/Controllers/Qms/FeedbackAdminController.php index 08133bb..23ddfe5 100644 --- a/app/Http/Controllers/Qms/FeedbackAdminController.php +++ b/app/Http/Controllers/Qms/FeedbackAdminController.php @@ -32,10 +32,21 @@ class FeedbackAdminController extends Controller ->when($branchScope, fn ($q) => $q->whereHas('ticket', fn ($t) => $t->where('branch_id', $branchScope))) ->avg('rating'); + $feedbackQuery = CustomerFeedback::owned($owner) + ->where('organization_id', $organization->id) + ->when($branchScope, fn ($q) => $q->whereHas('ticket', fn ($t) => $t->where('branch_id', $branchScope))); + + $heroStats = [ + 'total' => (clone $feedbackQuery)->count(), + 'avg_rating' => round((float) $avgRating, 1), + 'this_month' => (clone $feedbackQuery)->where('created_at', '>=', now()->startOfMonth())->count(), + ]; + return view('qms.feedback.index', [ 'feedback' => $feedback, 'organization' => $organization, 'avgRating' => round((float) $avgRating, 1), + 'heroStats' => $heroStats, ]); } } diff --git a/app/Http/Controllers/Qms/MemberController.php b/app/Http/Controllers/Qms/MemberController.php index 4e90077..d0964c4 100644 --- a/app/Http/Controllers/Qms/MemberController.php +++ b/app/Http/Controllers/Qms/MemberController.php @@ -27,10 +27,19 @@ class MemberController extends Controller ->orderBy('created_at') ->get(); + $operatorRoles = ['queue_operator', 'counter_staff', 'receptionist']; + + $heroStats = [ + 'total' => $members->count(), + 'operators' => $members->whereIn('role', $operatorRoles)->count(), + 'branches' => $members->whereNotNull('branch_id')->pluck('branch_id')->unique()->count(), + ]; + return view('qms.admin.members.index', [ 'members' => $members, 'organization' => $organization, 'roles' => config('qms.roles'), + 'heroStats' => $heroStats, ]); } diff --git a/app/Http/Controllers/Qms/ReportController.php b/app/Http/Controllers/Qms/ReportController.php index 1bc499b..4632223 100644 --- a/app/Http/Controllers/Qms/ReportController.php +++ b/app/Http/Controllers/Qms/ReportController.php @@ -36,6 +36,10 @@ class ReportController extends Controller 'organization' => $organization, 'branches' => $branches, 'reports' => config('qms.report_types'), + 'heroStats' => [ + 'reports' => count(config('qms.report_types')), + 'branches' => $branches->count(), + ], ]); } diff --git a/app/Http/Controllers/Qms/ServiceQueueController.php b/app/Http/Controllers/Qms/ServiceQueueController.php index 9f008de..6f565c8 100644 --- a/app/Http/Controllers/Qms/ServiceQueueController.php +++ b/app/Http/Controllers/Qms/ServiceQueueController.php @@ -30,7 +30,18 @@ class ServiceQueueController extends Controller ->orderBy('name') ->paginate(20); - return view('qms.queues.index', compact('queues', 'organization')); + $queueStats = ServiceQueue::owned($owner) + ->where('organization_id', $organization->id) + ->when(true, fn ($q) => $this->scopeToBranch($request, $q)) + ->get(); + + $heroStats = [ + 'total' => $queueStats->count(), + 'active' => $queueStats->where('is_active', true)->where('is_paused', false)->count(), + 'paused' => $queueStats->where('is_paused', true)->count(), + ]; + + return view('qms.queues.index', compact('queues', 'organization', 'heroStats')); } public function show(Request $request, ServiceQueue $serviceQueue): View diff --git a/app/Http/Controllers/Qms/TicketController.php b/app/Http/Controllers/Qms/TicketController.php index b069468..bb93fc1 100644 --- a/app/Http/Controllers/Qms/TicketController.php +++ b/app/Http/Controllers/Qms/TicketController.php @@ -37,7 +37,15 @@ class TicketController extends Controller $queues = ServiceQueue::owned($owner)->where('organization_id', $organization->id)->orderBy('name')->get(); - return view('qms.tickets.index', compact('tickets', 'queues', 'organization')); + $ticketQuery = Ticket::owned($owner)->where('organization_id', $organization->id); + + $heroStats = [ + 'today' => (clone $ticketQuery)->whereDate('issued_at', today())->count(), + 'waiting' => (clone $ticketQuery)->where('status', 'waiting')->count(), + 'serving' => (clone $ticketQuery)->whereIn('status', ['called', 'serving', 'on_hold'])->count(), + ]; + + return view('qms.tickets.index', compact('tickets', 'queues', 'organization', 'heroStats')); } public function create(Request $request): View diff --git a/app/Http/Controllers/Qms/WorkflowController.php b/app/Http/Controllers/Qms/WorkflowController.php index 7902229..6b98d3c 100644 --- a/app/Http/Controllers/Qms/WorkflowController.php +++ b/app/Http/Controllers/Qms/WorkflowController.php @@ -34,7 +34,13 @@ class WorkflowController extends Controller ->orderBy('name') ->get(); - return view('qms.workflows.index', compact('workflows', 'organization')); + $heroStats = [ + 'total' => $workflows->count(), + 'active' => $workflows->where('is_active', true)->count(), + 'steps' => $workflows->sum('steps_count'), + ]; + + return view('qms.workflows.index', compact('workflows', 'organization', 'heroStats')); } public function create(Request $request): View diff --git a/resources/views/components/qms/page-hero.blade.php b/resources/views/components/qms/page-hero.blade.php new file mode 100644 index 0000000..a8ea8f0 --- /dev/null +++ b/resources/views/components/qms/page-hero.blade.php @@ -0,0 +1,39 @@ +@props([ + 'badge', + 'title', + 'description' => null, + 'stats' => [], +]) + +
merge(['class' => 'relative overflow-hidden rounded-2xl border border-slate-200 bg-white']) }}> +
+
+
+
+
+ {{ $badge }} +
+

{{ $title }}

+ @if ($description) +

{{ $description }}

+ @endif + @isset($actions) +
+ {{ $actions }} +
+ @endisset +
+ + @if (count($stats) > 0) +
+ @foreach ($stats as $stat) +
+

{{ $stat['value'] }}

+

{{ $stat['label'] }}

+
+ @endforeach +
+ @endif +
+
+
diff --git a/resources/views/qms/admin/branches/index.blade.php b/resources/views/qms/admin/branches/index.blade.php index a0d6d39..b8282b6 100644 --- a/resources/views/qms/admin/branches/index.blade.php +++ b/resources/views/qms/admin/branches/index.blade.php @@ -1,31 +1,51 @@ +@php + $canManageBranches = app(\App\Services\Qms\QmsPermissions::class)->can( + app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), + 'admin.branches.manage' + ); +@endphp + -
-

Branches

- @if(app(\App\Services\Qms\QmsPermissions::class)->can(app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), 'admin.branches.manage')) - New branch - @endif -
- @include('partials.flash') -
- - - - - - - - - - @foreach ($branches as $branch) - - - - - - - - @endforeach - -
NameCodeDepartmentsStatus
{{ $branch->name }}{{ $branch->code ?? '—' }}{{ $branch->departments_count }}{{ $branch->is_active ? 'Active' : 'Inactive' }}Edit
+
+ + @if ($canManageBranches) + + New branch + + @endif + + + @include('partials.flash') + +
+ + + + + + + + + + @foreach ($branches as $branch) + + + + + + + + @endforeach + +
NameCodeDepartmentsStatus
{{ $branch->name }}{{ $branch->code ?? '—' }}{{ $branch->departments_count }}{{ $branch->is_active ? 'Active' : 'Inactive' }}Edit
+
diff --git a/resources/views/qms/admin/departments/index.blade.php b/resources/views/qms/admin/departments/index.blade.php index 766c2d5..20ae581 100644 --- a/resources/views/qms/admin/departments/index.blade.php +++ b/resources/views/qms/admin/departments/index.blade.php @@ -1,31 +1,51 @@ +@php + $canManageDepartments = app(\App\Services\Qms\QmsPermissions::class)->can( + app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), + 'admin.departments.manage' + ); +@endphp + -
-

Departments

- @if(app(\App\Services\Qms\QmsPermissions::class)->can(app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), 'admin.departments.manage')) - New department - @endif -
- @include('partials.flash') -
- - - - - - - - - @forelse ($departments as $department) - - - - - - - @empty - - @endforelse - -
NameBranchType
{{ $department->name }}{{ $department->branch?->name }}{{ $types[$department->type] ?? $department->type }}Edit
No departments.
+
+ + @if ($canManageDepartments) + + New department + + @endif + + + @include('partials.flash') + +
+ + + + + + + + + @forelse ($departments as $department) + + + + + + + @empty + + @endforelse + +
NameBranchType
{{ $department->name }}{{ $department->branch?->name }}{{ $types[$department->type] ?? $department->type }}Edit
No departments.
+
diff --git a/resources/views/qms/admin/members/index.blade.php b/resources/views/qms/admin/members/index.blade.php index 054b95d..014e5e1 100644 --- a/resources/views/qms/admin/members/index.blade.php +++ b/resources/views/qms/admin/members/index.blade.php @@ -1,38 +1,58 @@ +@php + $canManageMembers = app(\App\Services\Qms\QmsPermissions::class)->can( + app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), + 'admin.members.manage' + ); +@endphp + -
-

Team members

- @if(app(\App\Services\Qms\QmsPermissions::class)->can(app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), 'admin.members.manage')) - Add member - @endif -
- @include('partials.flash') -
- - - - - - - - - @foreach ($members as $member) - @php - $display = str_contains($member->user_ref, '@') - ? $member->user_ref - : (\App\Models\User::where('public_id', $member->user_ref)->value('email') ?? $member->user_ref); - @endphp - - - - - - - @endforeach - -
MemberRoleBranch
{{ $display }}{{ $roles[$member->role] ?? $member->role }}{{ $member->branch?->name ?? 'All' }} - @if ($member->user_ref !== auth()->user()->public_id) -
@csrf @method('DELETE')
- @endif -
+
+ + @if ($canManageMembers) + + Add member + + @endif + + + @include('partials.flash') + +
+ + + + + + + + + @foreach ($members as $member) + @php + $display = str_contains($member->user_ref, '@') + ? $member->user_ref + : (\App\Models\User::where('public_id', $member->user_ref)->value('email') ?? $member->user_ref); + @endphp + + + + + + + @endforeach + +
MemberRoleBranch
{{ $display }}{{ $roles[$member->role] ?? $member->role }}{{ $member->branch?->name ?? 'All' }} + @if ($member->user_ref !== auth()->user()->public_id) +
@csrf @method('DELETE')
+ @endif +
+
diff --git a/resources/views/qms/analytics/index.blade.php b/resources/views/qms/analytics/index.blade.php index 0dda50d..1d10047 100644 --- a/resources/views/qms/analytics/index.blade.php +++ b/resources/views/qms/analytics/index.blade.php @@ -1,42 +1,51 @@ -

Analytics

-
- @foreach ([ - 'waiting' => 'Waiting now', - 'serving' => 'Being served', - 'served_today' => 'Served today', - 'no_shows_today' => 'No-shows today', - 'avg_wait_seconds' => 'Avg wait (sec)', - 'appointments_today' => 'Appointments today', - 'feedback_avg_30d' => 'Avg rating (30d)', - ] as $key => $label) -
-
{{ $label }}
-
{{ $overview[$key] ?? 0 }}
+
+ + +
+
+

14-day trend

+ + + + @foreach ($trend as $day) + + @endforeach + +
DateIssuedCompleted
{{ $day['date'] }}{{ $day['issued'] }}{{ $day['completed'] }}
+
+
+

Busiest queues

+
    + @forelse ($overview['busiest_queues'] ?? [] as $q) +
  • {{ $q['name'] }}{{ $q['waiting'] }} waiting
  • + @empty +
  • No active queues.
  • + @endforelse +
- @endforeach -
-
-
-

14-day trend

- - - - @foreach ($trend as $day) - - @endforeach - -
DateIssuedCompleted
{{ $day['date'] }}{{ $day['issued'] }}{{ $day['completed'] }}
-
-

Busiest queues

-
    - @forelse ($overview['busiest_queues'] ?? [] as $q) -
  • {{ $q['name'] }}{{ $q['waiting'] }} waiting
  • - @empty -
  • No active queues.
  • - @endforelse -
+ +
+ @foreach ([ + 'serving' => 'Being served', + 'no_shows_today' => 'No-shows today', + 'avg_wait_seconds' => 'Avg wait (sec)', + 'appointments_today' => 'Appointments today', + ] as $key => $label) +
+
{{ $label }}
+
{{ $overview[$key] ?? 0 }}
+
+ @endforeach
diff --git a/resources/views/qms/appointments/index.blade.php b/resources/views/qms/appointments/index.blade.php index 77eb539..e131481 100644 --- a/resources/views/qms/appointments/index.blade.php +++ b/resources/views/qms/appointments/index.blade.php @@ -1,47 +1,64 @@ +@php + $canManageAppointments = app(\App\Services\Qms\QmsPermissions::class)->can( + app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), + 'appointments.manage' + ); +@endphp + -
-
-

Appointments

-

Schedule and check in pre-booked customers.

-
- @if(app(\App\Services\Qms\QmsPermissions::class)->can(app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), 'appointments.manage')) - New appointment - @endif -
- @include('partials.flash') -
- - - - - - - - - - - - @forelse ($appointments as $appointment) +
+ + @if ($canManageAppointments) + + New appointment + + @endif + + + @include('partials.flash') + +
+
CustomerScheduledQueueStatus
+ - - - - - + + + + + - @empty - - @endforelse - -
{{ $appointment->customer_name }}{{ $appointment->scheduled_at->format('M j, H:i') }}{{ $appointment->serviceQueue?->name ?? '—' }}{{ str_replace('_', ' ', $appointment->status) }} - @if ($appointment->status === 'scheduled') - Edit -
@csrf
-
@csrf
- @elseif ($appointment->ticket) - View ticket - @endif -
CustomerScheduledQueueStatus
No appointments yet.
+ + + @forelse ($appointments as $appointment) + + {{ $appointment->customer_name }} + {{ $appointment->scheduled_at->format('M j, H:i') }} + {{ $appointment->serviceQueue?->name ?? '—' }} + {{ str_replace('_', ' ', $appointment->status) }} + + @if ($appointment->status === 'scheduled') + Edit +
@csrf
+
@csrf
+ @elseif ($appointment->ticket) + View ticket + @endif + + + @empty + No appointments yet. + @endforelse + + +
+
{{ $appointments->links() }}
-
{{ $appointments->links() }}
diff --git a/resources/views/qms/counters/index.blade.php b/resources/views/qms/counters/index.blade.php index 3f9b468..218d48c 100644 --- a/resources/views/qms/counters/index.blade.php +++ b/resources/views/qms/counters/index.blade.php @@ -1,42 +1,50 @@ -
-
-

Counters

-

Service desks and windows where staff call and serve tickets

-
- New counter -
+
+ + + New counter + + -
- @forelse ($counters as $counter) - - @empty - - @endforelse -
- @if ($counters->hasPages()) -
{{ $counters->links() }}
- @endif + @if ($counters->hasPages()) +
{{ $counters->links() }}
+ @endif +
diff --git a/resources/views/qms/devices/index.blade.php b/resources/views/qms/devices/index.blade.php index ee2cf30..48c24e2 100644 --- a/resources/views/qms/devices/index.blade.php +++ b/resources/views/qms/devices/index.blade.php @@ -1,75 +1,83 @@ -
-
-

Devices

-

Kiosks and ticket printers for self-service and reception

-
- @if ($canManage) - Register device +
+ + @if ($canManage) + + Register device + + @endif + + + @if (session('success')) +
{{ session('success') }}
@endif -
- @if (session('success')) -
{{ session('success') }}
- @endif - -
- @if ($devices->isEmpty()) - - - - - - - @if ($canManage) - - Register your first device - - @endif - - @else - - - - - - - - - - - - @foreach ($devices as $device) +
+ @if ($devices->isEmpty()) + + + + + + + @if ($canManage) + + Register your first device + + @endif + + @else +
NameTypeStatusBranch
+ - - - - - + + + + + - @endforeach - -
{{ $device->name }}{{ $deviceTypes[$device->type] ?? $device->type }} - - {{ ucfirst($device->status) }} - - {{ $device->branch?->name ?? '—' }} - @if ($device->type === 'kiosk' && $device->device_token) - Open kiosk - @endif - @if ($canManage) -
- @csrf - -
- @endif -
NameTypeStatusBranch
-
- {{ $devices->links() }} -
- @endif + + + @foreach ($devices as $device) + + {{ $device->name }} + {{ $deviceTypes[$device->type] ?? $device->type }} + + + {{ ucfirst($device->status) }} + + + {{ $device->branch?->name ?? '—' }} + + @if ($device->type === 'kiosk' && $device->device_token) + Open kiosk + @endif + @if ($canManage) +
+ @csrf + +
+ @endif + + + @endforeach + + +
+ {{ $devices->links() }} +
+ @endif +
diff --git a/resources/views/qms/displays/index.blade.php b/resources/views/qms/displays/index.blade.php index 4d7ca88..24fadf7 100644 --- a/resources/views/qms/displays/index.blade.php +++ b/resources/views/qms/displays/index.blade.php @@ -1,59 +1,67 @@ -
-
-

Display screens

-

Waiting-area screens and voice announcements for called tickets

-
- @if ($canManage) - New display - @endif -
+
+ + @if ($canManage) + + New display + + @endif + -
- @if ($screens->isEmpty()) - - - - - - - @if ($canManage) - - Create your first display - - @endif - - @else - - - - - - - - - - - @foreach ($screens as $screen) +
+ @if ($screens->isEmpty()) + + + + + + + @if ($canManage) + + Create your first display + + @endif + + @else +
NameLayoutBranch
+ - - - - + + + + - @endforeach - -
- {{ $screen->name }} - {{ config('qms.display_layouts.'.$screen->layout, $screen->layout) }}{{ $screen->branch?->name ?? '—' }} - Open display - NameLayoutBranch
-
- {{ $screens->links() }} -
- @endif + + + @foreach ($screens as $screen) + + + {{ $screen->name }} + + {{ config('qms.display_layouts.'.$screen->layout, $screen->layout) }} + {{ $screen->branch?->name ?? '—' }} + + Open display + + + @endforeach + + +
+ {{ $screens->links() }} +
+ @endif +
diff --git a/resources/views/qms/feedback/index.blade.php b/resources/views/qms/feedback/index.blade.php index 44a07ac..d7285db 100644 --- a/resources/views/qms/feedback/index.blade.php +++ b/resources/views/qms/feedback/index.blade.php @@ -1,29 +1,37 @@ -
-

Customer feedback

-

Average rating: {{ $avgRating ?: '—' }} / 5

+
+ + +
+ + + + + + + + + @forelse ($feedback as $item) + + + + + + + @empty + + @endforelse + +
TicketRatingCommentsWhen
{{ $item->ticket?->ticket_number }}{{ $item->rating }}/5{{ Str::limit($item->comments, 80) }}{{ $item->created_at->diffForHumans() }}
No feedback yet.
+
+
{{ $feedback->links() }}
-
- - - - - - - - - @forelse ($feedback as $item) - - - - - - - @empty - - @endforelse - -
TicketRatingCommentsWhen
{{ $item->ticket?->ticket_number }}{{ $item->rating }}/5{{ Str::limit($item->comments, 80) }}{{ $item->created_at->diffForHumans() }}
No feedback yet.
-
-
{{ $feedback->links() }}
diff --git a/resources/views/qms/queues/index.blade.php b/resources/views/qms/queues/index.blade.php index 23d327f..f28e303 100644 --- a/resources/views/qms/queues/index.blade.php +++ b/resources/views/qms/queues/index.blade.php @@ -1,73 +1,89 @@ +@php + $canManageQueues = app(\App\Services\Qms\QmsPermissions::class)->can( + app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), + 'queues.manage' + ); +@endphp + -
-
-

Service queues

-

Configure queues for reception, counters, and departments.

-
- @if(app(\App\Services\Qms\QmsPermissions::class)->can(app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), 'queues.manage')) - New queue +
+ + @if ($canManageQueues) + + New queue + + @endif + + + @if (session('success')) +
{{ session('success') }}
@endif -
- @if (session('success')) -
{{ session('success') }}
- @endif - -
- @if ($queues->isEmpty()) -
- No queues yet. Create your first service queue to start issuing tickets. -
- @else - - - - - - - - - - - - @foreach ($queues as $queue) +
+ @if ($queues->isEmpty()) +
+ No queues yet. Create your first service queue to start issuing tickets. +
+ @else +
QueueBranchPrefixStrategyStatus
+ - - - - - - + + + + + + - @endforeach - -
-
- - - {{ $queue->name }} - -
-
{{ $queue->branch?->name }}{{ $queue->prefix }}{{ config('qms.queue_strategies.'.$queue->strategy, $queue->strategy) }} -
- @if ($queue->is_paused) - Paused -
@csrf
- @elseif ($queue->is_active) - Active -
@csrf
- @else - Inactive - @endif -
-
- @if(app(\App\Services\Qms\QmsPermissions::class)->can(app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), 'rules.view')) - Rules - @endif - QueueBranchPrefixStrategyStatus
-
- {{ $queues->links() }} -
- @endif + + + @foreach ($queues as $queue) + + +
+ + + {{ $queue->name }} + +
+ + {{ $queue->branch?->name }} + {{ $queue->prefix }} + {{ config('qms.queue_strategies.'.$queue->strategy, $queue->strategy) }} + +
+ @if ($queue->is_paused) + Paused +
@csrf
+ @elseif ($queue->is_active) + Active +
@csrf
+ @else + Inactive + @endif +
+ + + @if(app(\App\Services\Qms\QmsPermissions::class)->can(app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), 'rules.view')) + Rules + @endif + + + @endforeach + + +
+ {{ $queues->links() }} +
+ @endif +
diff --git a/resources/views/qms/reports/index.blade.php b/resources/views/qms/reports/index.blade.php index 7f8f630..cda9fe3 100644 --- a/resources/views/qms/reports/index.blade.php +++ b/resources/views/qms/reports/index.blade.php @@ -1,11 +1,22 @@ -

Reports

-
- @foreach ($reports as $type => $label) - -

{{ $label }}

-

View metrics and export CSV

-
- @endforeach +
+ + +
+ @foreach ($reports as $type => $label) + +

{{ $label }}

+

View metrics and export CSV

+
+ @endforeach +
diff --git a/resources/views/qms/tickets/index.blade.php b/resources/views/qms/tickets/index.blade.php index 69e56c2..73bafaa 100644 --- a/resources/views/qms/tickets/index.blade.php +++ b/resources/views/qms/tickets/index.blade.php @@ -1,70 +1,85 @@ +@php + $canIssueTickets = app(\App\Services\Qms\QmsPermissions::class)->can( + app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), + 'tickets.issue' + ); +@endphp + -
-
-

Tickets

-

Live and historical queue tickets across all service lines

-
- @if(app(\App\Services\Qms\QmsPermissions::class)->can(app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), 'tickets.issue')) - Issue ticket - @endif -
+
+ + @if ($canIssueTickets) + + Issue ticket + + @endif + -
-
- - -
-
- - -
- - @if (request()->hasAny(['queue', 'status'])) - Clear - @endif -
+
+
+ + +
+
+ + +
+ + @if (request()->hasAny(['queue', 'status'])) + Clear + @endif +
-
- @if ($tickets->isEmpty()) - - @else - - - - - - - - - - - - - @foreach ($tickets as $ticket) - - - - - - - - - @endforeach - -
TicketCustomerQueueCounterStatusIssued
- {{ $ticket->ticket_number }} - {{ $ticket->customer_name ?: 'Walk-in' }}{{ $ticket->serviceQueue?->name }}{{ $ticket->counter?->name ?? '—' }}{{ $ticket->issued_at?->format('M j, H:i') }}
-
{{ $tickets->links() }}
- @endif -
+
+ @if ($tickets->isEmpty()) + + @else + + + + + + + + + + + + + @foreach ($tickets as $ticket) + + + + + + + + + @endforeach + +
TicketCustomerQueueCounterStatusIssued
+ {{ $ticket->ticket_number }} + {{ $ticket->customer_name ?: 'Walk-in' }}{{ $ticket->serviceQueue?->name }}{{ $ticket->counter?->name ?? '—' }}{{ $ticket->issued_at?->format('M j, H:i') }}
+
{{ $tickets->links() }}
+ @endif +
+
diff --git a/resources/views/qms/workflows/index.blade.php b/resources/views/qms/workflows/index.blade.php index 0fdebc2..c4a438d 100644 --- a/resources/views/qms/workflows/index.blade.php +++ b/resources/views/qms/workflows/index.blade.php @@ -1,29 +1,49 @@ +@php + $canManageWorkflows = app(\App\Services\Qms\QmsPermissions::class)->can( + app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), + 'workflows.manage' + ); +@endphp + -
-

Workflows

- @if(app(\App\Services\Qms\QmsPermissions::class)->can(app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user()), 'workflows.manage')) - New workflow - @endif -
- @include('partials.flash') -
- - - - - - - - @forelse ($workflows as $workflow) - - - - - - @empty - - @endforelse - -
NameStepsStatus
{{ $workflow->name }}{{ $workflow->steps_count }}{{ $workflow->is_active ? 'Active' : 'Inactive' }}
No workflows configured.
+
+ + @if ($canManageWorkflows) + + New workflow + + @endif + + + @include('partials.flash') + +
+ + + + + + + + @forelse ($workflows as $workflow) + + + + + + @empty + + @endforelse + +
NameStepsStatus
{{ $workflow->name }}{{ $workflow->steps_count }}{{ $workflow->is_active ? 'Active' : 'Inactive' }}
No workflows configured.
+