Deploy Ladill POS / deploy (push) Successful in 29s
Drop Devices from the main sidebar, surface a Devices card on the Settings page, and nest device routes under /settings/devices with legacy redirects.
59 lines
3.6 KiB
PHP
59 lines
3.6 KiB
PHP
<x-app-layout title="Add device">
|
|
<x-settings.page description="Name the hardware and link it to a branch when needed.">
|
|
<div class="mb-4 flex flex-wrap items-center gap-1 text-sm text-slate-500">
|
|
<a href="{{ route('pos.settings') }}" class="hover:text-slate-800">Settings</a>
|
|
<span class="px-1">/</span>
|
|
<a href="{{ route('pos.devices.index') }}" class="hover:text-slate-800">Devices</a>
|
|
<span class="px-1">/</span>
|
|
<span class="font-medium text-slate-900">Add</span>
|
|
</div>
|
|
|
|
@if (session('error'))
|
|
<div class="mb-4 rounded-xl border border-rose-200 bg-rose-50 px-4 py-3 text-sm text-rose-800">{{ session('error') }}</div>
|
|
@endif
|
|
|
|
<x-settings.card title="Register device">
|
|
<form method="POST" action="{{ route('pos.devices.store') }}"
|
|
class="space-y-4"
|
|
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>
|
|
<div class="flex flex-wrap gap-3 pt-1">
|
|
<a href="{{ route('pos.settings') }}#devices" class="inline-flex items-center justify-center rounded-xl border border-slate-200 px-4 py-2.5 text-sm font-medium text-slate-700 hover:bg-slate-50">Cancel</a>
|
|
<button type="submit" class="btn-primary">Register device</button>
|
|
</div>
|
|
</form>
|
|
</x-settings.card>
|
|
</x-settings.page>
|
|
</x-app-layout>
|