attributes->get('qms.device'); $device->loadMissing('organization'); $queues = $this->kiosk->queuesFor($device); $settings = $this->kiosk->settings($device); $organization = $device->organization; $this->devices->recordHeartbeat($device); return view('qms.kiosk.device', [ 'device' => $device, 'organization' => $organization, 'queues' => $queues, 'settings' => $settings, 'logoUrl' => $organization ? OrganizationBranding::logoUrl($organization) : OrganizationBranding::assetUrl(), 'logoAlt' => $organization ? OrganizationBranding::logoAlt($organization) : 'Ladill Queue', ]); } public function issue(Request $request): JsonResponse { $device = $request->attributes->get('qms.device'); $this->devices->recordHeartbeat($device); $validated = $request->validate([ 'queue_id' => ['required', 'integer', 'exists:queue_service_queues,id'], 'customer_name' => ['nullable', 'string', 'max:255'], 'customer_phone' => ['nullable', 'string', 'max:50'], 'priority' => ['nullable', 'string'], ]); abort_unless($this->kiosk->queueAllowedForIssue($device, (int) $validated['queue_id']), 403); $queue = ServiceQueue::findOrFail($validated['queue_id']); abort_if($queue->is_paused || ! $queue->is_active, 422, 'This queue is not accepting tickets right now.'); $ticket = $this->engine->issueTicket($queue, $device->owner_ref, [ 'customer_name' => $validated['customer_name'] ?? null, 'customer_phone' => $validated['customer_phone'] ?? null, 'priority' => $validated['priority'] ?? 'walk_in', 'source' => 'kiosk', ]); return response()->json(['data' => TicketPresenter::toArray($ticket)]); } }