@extends('admin.layouts.master') @section('title', isset($user) ? 'Edit User' : 'Create New User') @section('css') @endsection @section('content') {{-- ── Header ── --}}

{{ isset($user) ? 'Edit User' : 'Create New User' }}

@if(isset($user))

Editing: {{ $user->name }}

@else

Add a new user to the system

@endif
Back to List
@include('components.alert')
@csrf @if(isset($user)) @method('PUT') @endif {{-- ══════════════════════ Photo + Basic Info ══════════════════════ --}}
Account Information
{{-- Avatar zone --}}

Profile Photo

@if(isset($user) && $user->image)
Current photo saved
@endif

Choose a square JPG or PNG.
Max size: 2 MB.

@if(isset($user))
Leave the password field blank to keep the current password unchanged.
@endif {{-- Full Name --}}
@error('name'){{ $message }}@enderror
{{-- Username --}}
@error('username'){{ $message }}@enderror
{{-- Email --}}
@error('email'){{ $message }}@enderror
{{-- Phone --}}
{{-- Password --}}
@error('password'){{ $message }}@enderror
{{-- Designation --}}
@error('designation_id'){{ $message }}@enderror
{{-- ══════════════════════ Assign Roles ══════════════════════ --}}
Assign Roles
@foreach ($roles as $role_id => $role_name) @php $checked = isset($user) && $user->roles->pluck('id')->contains($role_id); @endphp @endforeach
@if(count($roles) === 0)

No roles available

@endif
{{-- ── Actions ── --}}
Cancel
@endsection @section('js') @endsection