@extends('layouts.dashboard') @section('title', 'Edit User') @section('content') @php $isSP = auth()->user()->role->slug === 'sp'; @endphp
@if($errors->any())

Please fix the following errors:

@endif

Edit Staff Account

Update account details and regional system permissions.

{{ $user->employee_code }}
@csrf @method('PUT') @if($isSP) @endif {{-- PROFILE --}}

Profile & Account Credentials

@error('email')

{{ $message }}

@enderror

Leave empty or use OE followed by 3 digits, for example OE001.

@error('employee_code')

{{ $message }}

@enderror
{{-- Password fields: optional on edit --}}

Leave blank to keep current password.

{{-- ROLE & GEOGRAPHY --}}

System Access Hierarchy & Scope

{{-- Role --}}
{{-- SP/VP: Geography fields --}} @if(in_array(auth()->user()->role->slug, ['sp', 'vp'], true)) @endif {{-- SD: District only --}} @if(auth()->user()->role->slug == 'sd')
@endif {{-- SP: Manager display badge --}} @if($isSP)
{{ $user->manager ? $user->manager->name . ' (' . strtoupper($user->manager->role->slug ?? '') . ')' : 'Click to select' }}
@endif
{{-- Actions --}}
Cancel
@if($isSP) {{-- MANAGER PICKER MODAL --}} @endif @endsection