Deploy Ladill Frontdesk / deploy (push) Successful in 40s
Populate the dropdown from team members and linked hosts, show name and email labels, and block linking a user already tied to another employee. Co-authored-by: Cursor <cursoragent@cursor.com>
59 lines
3.6 KiB
PHP
59 lines
3.6 KiB
PHP
<x-app-layout title="Add employee">
|
||
<div class="mx-auto max-w-lg">
|
||
<h1 class="text-xl font-semibold text-slate-900">Add employee</h1>
|
||
<p class="mt-1 text-sm text-slate-500">Staff use their employee code and PIN at the reception kiosk.</p>
|
||
<form method="POST" action="{{ route('frontdesk.employees.store') }}" class="mt-6 space-y-4 rounded-2xl border border-slate-200 bg-white p-6">
|
||
@csrf
|
||
<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') }}" 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">PIN (4–6 digits)</label>
|
||
<input type="password" name="pin" inputmode="numeric" pattern="\d{4,6}" required 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">Full name</label>
|
||
<input type="text" name="full_name" value="{{ old('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') }}" 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') }}" 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') }}" 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') == $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') == $host->id)>{{ $host->name }}</option>
|
||
@endforeach
|
||
</select>
|
||
<p class="mt-1 text-xs text-slate-500">When stepped out, linked hosts show as unavailable to visitors.</p>
|
||
</div>
|
||
@include('frontdesk.employees.partials.user-ref-select', ['selectedUserRef' => old('user_ref')])
|
||
<button type="submit" class="btn-primary w-full">Save employee</button>
|
||
</form>
|
||
</div>
|
||
</x-app-layout>
|