Files
ladill-frontdesk/resources/views/frontdesk/employees/edit.blade.php
T
isaaccladandCursor 890c2c71e3
Deploy Ladill Frontdesk / deploy (push) Failing after 26s
Add employee presence with kiosk sign-in, QR badges, and mobile step-out.
Enables staff roster, PIN/code kiosk flow, attendance reports, evacuation staff roll call, webhooks, branch mismatch warnings, and a linked-user My presence portal.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 21:11:18 +00:00

81 lines
5.2 KiB
PHP

<x-app-layout title="Edit employee">
<div class="mx-auto max-w-lg">
<h1 class="text-xl font-semibold text-slate-900">Edit employee</h1>
<form method="POST" action="{{ route('frontdesk.employees.update', $employee) }}" class="mt-6 space-y-4 rounded-2xl border border-slate-200 bg-white p-6">
@csrf @method('PUT')
<div class="grid gap-4 sm:grid-cols-2">
<div>
<label class="block text-sm font-medium text-slate-700">Employee code</label>
<input type="text" name="employee_code" value="{{ old('employee_code', $employee->employee_code) }}" required class="mt-1 w-full rounded-lg border-slate-300 font-mono text-sm uppercase">
</div>
<div>
<label class="block text-sm font-medium text-slate-700">New PIN (optional)</label>
<input type="password" name="pin" inputmode="numeric" pattern="\d{4,6}" class="mt-1 w-full rounded-lg border-slate-300 text-sm" placeholder="Leave blank to keep">
</div>
</div>
<div>
<label class="block text-sm font-medium text-slate-700">Full name</label>
<input type="text" name="full_name" value="{{ old('full_name', $employee->full_name) }}" required class="mt-1 w-full rounded-lg border-slate-300 text-sm">
</div>
<div>
<label class="block text-sm font-medium text-slate-700">Department</label>
<input type="text" name="department" value="{{ old('department', $employee->department) }}" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
</div>
<div class="grid gap-4 sm:grid-cols-2">
<div>
<label class="block text-sm font-medium text-slate-700">Email</label>
<input type="email" name="email" value="{{ old('email', $employee->email) }}" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
</div>
<div>
<label class="block text-sm font-medium text-slate-700">Phone</label>
<input type="tel" name="phone" value="{{ old('phone', $employee->phone) }}" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
</div>
</div>
<div>
<label class="block text-sm font-medium text-slate-700">Branch</label>
<select name="branch_id" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
<option value="">All branches</option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected(old('branch_id', $employee->branch_id) == $branch->id)>{{ $branch->name }}</option>
@endforeach
</select>
</div>
<div>
<label class="block text-sm font-medium text-slate-700">Linked host (optional)</label>
<select name="host_id" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
<option value="">None</option>
@foreach ($hosts as $host)
<option value="{{ $host->id }}" @selected(old('host_id', $employee->host_id) == $host->id)>{{ $host->name }}</option>
@endforeach
</select>
</div>
<div>
<label class="block text-sm font-medium text-slate-700">Linked Ladill user (for mobile step-out)</label>
<input type="text" name="user_ref" value="{{ old('user_ref', $employee->user_ref) }}" placeholder="User public ID" class="mt-1 w-full rounded-lg border-slate-300 font-mono text-sm">
<p class="mt-1 text-xs text-slate-400">Enables the My presence portal for this employee.</p>
</div>
<label class="flex items-center gap-2 text-sm">
<input type="checkbox" name="active" value="1" @checked(old('active', $employee->active)) class="rounded border-slate-300">
Active (can use kiosk)
</label>
@if ($employee->presence)
<div class="rounded-lg bg-slate-50 p-3 text-sm text-slate-600">
Current status:
<span class="font-medium">{{ config('frontdesk.employee_presence_statuses.'.$employee->presence->status, $employee->presence->status) }}</span>
@if ($employee->presence->destination)
· {{ $employee->presence->destination }}
@endif
</div>
@endif
<div class="flex gap-3 pt-2">
<a href="{{ route('frontdesk.employees.index') }}" class="flex-1 rounded-lg border border-slate-200 py-2 text-center text-sm">Back</a>
<button type="submit" class="btn-primary flex-1">Save</button>
</div>
</form>
<form method="POST" action="{{ route('frontdesk.employees.destroy', $employee) }}" class="mt-4" onsubmit="return confirm('Remove this employee?')">
@csrf @method('DELETE')
<button type="submit" class="text-sm text-red-600 hover:underline">Remove employee</button>
</form>
</div>
</x-app-layout>