@php // Client-side open seed — deferred $set (arg 3 = false) never fires /livewire/update. $blank = ['editingId' => null, 'first_name' => '', 'last_name' => '', 'email' => '', 'password' => '', 'role' => 'staff', 'roleLocked' => false, 'showModal' => true]; @endphp
@forelse ($staff as $u) @php // Answers computed once by the component (rowGuards): who may be // administered, and whose chair may not be emptied. $g = $guards[$u->id] ?? ['locked' => false, 'lastSuper' => false, 'statusLocked' => false, 'deleteLocked' => false]; $edit = ['editingId' => $u->id, 'first_name' => (string) $u->first_name, 'last_name' => (string) $u->last_name, 'email' => (string) $u->email, 'password' => '', 'role' => $u->roles->first()?->name ?? 'staff', 'roleLocked' => $g['lastSuper'], 'showModal' => true]; @endphp @empty @endforelse
{{ __('No.') }} {{ __('Staff Account') }} {{ __('Role') }} {{ __('Created') }} {{ __('Status') }} {{ __('Action') }}
{{ $loop->iteration + ($staff->firstItem() - 1) }}
{{ $u->display_name }} @if ($u->is_super){{ __('Owner') }}@endif
{{ $u->email }}
{{ __(ucwords(str_replace('_', ' ', $u->roles->first()?->name ?? '—'))) }} {{ rf_date($u->created_at) }} @if ($g['statusLocked']) {{-- A switch whose only possible answer is "no" is a lie. It is shown in its real state and disabled instead. --}} @else @endif @unless ($g['locked']) @else {{ __('Super admin — read only') }} @endunless @unless ($g['deleteLocked']) @endunless
@if ($staff->hasPages())
{{ $staff->links() }}
@endif
@error('first_name')

{{ $message }}

@enderror
@error('email')

{{ $message }}

@enderror
@error('password')

{{ $message }}

@enderror
{{-- Frozen while the account open here is the last active super admin. The server refuses that demotion anyway, and a select that accepts a change it will not keep is worse than one that cannot move. --}}

{{ __('The system must always have at least one active super admin.') }}