@extends ('admin.layouts.default') @section ('main')

@php echo (isset($user)) ? __('labels.user.edit_user') : __('labels.user.create_user'); @endphp

@include('admin.partials.x-toolbar') @php $action = (isset($user)) ? route('admin.users.update', $query) : route('admin.users.store', $query) @endphp
@csrf @if (isset($user)) @method('put') @endif @foreach ($fields as $field) @php if (isset($user)) { $value = old($field->name, $field->value); // The current user is editing their own account or the role is private. if ($field->name == 'role' && (auth()->user()->id == $user->id || $user->isRolePrivate())) { $field->extra = ['disabled']; } } else { if ($field->name == 'created_at' || $field->name == 'updated_at') { continue; } $value = old($field->name); } @endphp
@if ($field->name == 'photo')
@php $path = (isset($user) && $user->photo) ? url('/').$user->photo->getThumbnailUrl() : asset('/images/user.png'); @endphp
@endif @endforeach @if (isset($user)) @endif @if (isset($user))
@method('delete') @csrf
@method('delete') @csrf
@endif @endsection @push ('style') @endpush @push ('scripts') @endpush