36 lines
2.0 KiB
PHP
36 lines
2.0 KiB
PHP
<x-layouts.app :title="__('Edit user')">
|
|
<div class="mx-auto max-w-2xl space-y-6">
|
|
<div>
|
|
<h1 class="text-2xl font-semibold tracking-tight text-zinc-950 dark:text-zinc-100">Edit user</h1>
|
|
<p class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">Update account details and roles.</p>
|
|
</div>
|
|
|
|
<form method="POST" action="{{ route('administration.users.update', $user) }}" class="space-y-5 rounded-xl border border-zinc-200 bg-white p-6 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
|
|
@csrf
|
|
@method('PUT')
|
|
|
|
<flux:input name="name" :label="__('Name')" :value="old('name', $user->name)" required autofocus />
|
|
<flux:input name="email" type="email" :label="__('Email')" :value="old('email', $user->email)" required />
|
|
<flux:input name="password" type="password" :label="__('New password')" />
|
|
<flux:input name="password_confirmation" type="password" :label="__('Confirm new password')" />
|
|
|
|
<div class="space-y-2">
|
|
<div class="text-sm font-medium text-zinc-700 dark:text-zinc-300">Roles</div>
|
|
<div class="grid gap-2 sm:grid-cols-2">
|
|
@foreach ($roles as $role)
|
|
<label class="flex items-center gap-2 rounded-lg border border-zinc-200 px-3 py-2 text-sm dark:border-zinc-700">
|
|
<input type="checkbox" name="roles[]" value="{{ $role }}" @checked(in_array($role, old('roles', $user->roles->pluck('name')->all()), true))>
|
|
<span>{{ $role }}</span>
|
|
</label>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex justify-end gap-3">
|
|
<flux:button :href="route('administration.users.index')" wire:navigate>Cancel</flux:button>
|
|
<flux:button variant="primary" type="submit">Save changes</flux:button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</x-layouts.app>
|