Files
ladill-pos/resources/views/pos/devices/create.blade.php
T
isaacclad c01518b0ee
Deploy Ladill POS / deploy (push) Successful in 42s
Add Frontdesk-style Devices registry for POS hardware.
Register tills, customer displays, kitchen screens, printers, scanners,
and tablets per branch. Customer displays share the branch display token
and mark online when the public screen polls; stale devices go offline
on a schedule.
2026-07-15 21:49:21 +00:00

52 lines
3.0 KiB
PHP

<x-app-layout title="Add device">
<div class="mx-auto max-w-lg space-y-6">
<div>
<a href="{{ route('pos.devices.index') }}" class="text-sm font-medium text-slate-500 hover:text-slate-800"> Devices</a>
<h1 class="mt-2 text-2xl font-semibold text-slate-900">Register device</h1>
<p class="mt-1 text-sm text-slate-500">Name the hardware and link it to a branch when needed.</p>
</div>
@if (session('error'))
<div class="rounded-xl border border-rose-200 bg-rose-50 px-4 py-3 text-sm text-rose-800">{{ session('error') }}</div>
@endif
<form method="POST" action="{{ route('pos.devices.store') }}"
class="space-y-4 rounded-2xl border border-slate-200 bg-white p-6"
x-data="{ type: @js(old('type', 'register')), hints: @js($hints) }">
@csrf
<div>
<label class="block text-sm font-medium text-slate-700">Name</label>
<input type="text" name="name" value="{{ old('name') }}" required placeholder="Front till · Customer screen"
class="mt-1.5 w-full rounded-xl border-slate-300 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
@error('name') <p class="mt-1 text-xs text-rose-600">{{ $message }}</p> @enderror
</div>
<div>
<label class="block text-sm font-medium text-slate-700">Type</label>
<select name="type" required x-model="type"
class="mt-1.5 w-full rounded-xl border-slate-300 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
@foreach ($deviceTypes as $key => $label)
<option value="{{ $key }}">{{ $label }}</option>
@endforeach
</select>
<p class="mt-2 text-xs text-slate-500" x-text="hints[type] || ''"></p>
@error('type') <p class="mt-1 text-xs text-rose-600">{{ $message }}</p> @enderror
</div>
<div>
<label class="block text-sm font-medium text-slate-700">Branch</label>
<select name="location_id"
class="mt-1.5 w-full rounded-xl border-slate-300 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
<option value=""> Optional / all branches </option>
@foreach ($locations as $location)
<option value="{{ $location->id }}" @selected((string) old('location_id', $defaultLocationId) === (string) $location->id)>
{{ $location->name }}
</option>
@endforeach
</select>
<p class="mt-1 text-xs text-slate-400">Required for customer and kitchen displays.</p>
@error('location_id') <p class="mt-1 text-xs text-rose-600">{{ $message }}</p> @enderror
</div>
<button type="submit" class="btn-primary w-full">Register device</button>
</form>
</div>
</x-app-layout>