@php $isEdit = $user->exists; $action = $isEdit ? route('admin.users.update', $user) : route('admin.users.store'); $input = 'w-full px-4 py-2.5 bg-surface-container rounded-lg border-none focus:ring-2 focus:ring-primary/20 text-body-md outline-none'; $label = 'block text-label-md font-label-md text-on-surface-variant mb-1.5'; $roleNames = $user->exists ? $user->roles->pluck('name') : collect(); $hasRm = $roleNames->contains('registered_manager'); $hasSm = $roleNames->contains('service_manager'); // Base role for the select: RM is the base when someone holds RM (+ maybe SM). $currentRole = old('role', $hasRm ? 'registered_manager' : $roleNames->first()); $alsoSm = (bool) old('also_service_manager', $hasRm && $hasSm); $isOperational = \App\Models\User::isOperationalRole($currentRole); $val = fn ($field, $default = null) => old($field, $default ?? $user->{$field}); $dateVal = fn ($field) => old($field, $user->{$field}?->format('Y-m-d')); @endphp
@csrf @if($isEdit) @method('PUT') @endif {{-- Personal --}}

Personal Details

Full name is set automatically from first + last name.

{{-- Account & Role --}}

Account & Role

{{-- Service Manager title: Team Leader / Deputy Manager — same role and rights as SM --}}

Same access and rights as a Service Manager — shown as the position.

@if(auth()->user()->hasRole('admin'))
@elseif(! $isEdit)
key A secure password is generated automatically and sent in their welcome email, with a link to set their own.
@endif
{{-- Exception: a Registered Manager who also hands-on manages a service --}}
{{-- Employment --}}

Employment

@php $curLoc = (int) $val('location_service_id'); $curLocName = optional($services->firstWhere('id', $curLoc))->name; @endphp
@include('admin.users._service-multiselect', ['name' => 'secondary_service_ids', 'selected' => old('secondary_service_ids', $secondaryServiceIds), 'services' => $services])
corporate_fare Head Office
{{-- Select for management + head-office roles (options set by role via JS) --}} {{-- Care worker: derived from their service's Service Manager --}} {{-- CEO: top of the hierarchy --}}
{{-- Services this manager runs (Service Manager can hold several) --}} {{-- Services this manager oversees (Registered Manager can hold several) --}} {{-- Office Manager: the Registered Manager whose homes they oversee --}}
{{-- Contact --}}

Contact

{{-- Address --}}

Address

{{-- Induction Training (Face to Face) — book the starter onto upcoming induction dates --}}

event_available Induction Training (Face to Face)

Optional — pick a date for each induction day. They get a booking email with the details, and the Registered Manager and Service Manager of their service{{ $isEdit ? '' : 's' }} are emailed too.

@if($inductionBookings->isNotEmpty())
@foreach($inductionBookings as $b) {{ $b['status'] === 'attended' ? 'check_circle' : 'event' }} {{ $b['title'] }} · {{ $b['date']->format('j M Y') }} · {{ $b['status'] === 'attended' ? 'attended' : ($b['status'] === 'registered' ? 'booked' : str_replace('_', ' ', $b['status'])) }} @endforeach
@endif @if($inductionSessions->isEmpty())

No upcoming induction sessions are scheduled — a trainer needs to add them to the calendar first.

@else
@foreach($inductionSessions as $title => $runs)
@endforeach
@endif
Cancel