Files
ilycats/resources/views/pages/users/edit.blade.php
T
2026-02-08 15:16:35 +07:00

74 lines
4.9 KiB
PHP

<x-app-layout>
<div class="max-w-3xl mx-auto space-y-6 pb-12">
{{-- Header Section --}}
<div class="flex items-center gap-4">
<a href="{{ route('admin.users.index') }}" class="p-3 bg-white border border-slate-200 rounded-2xl text-slate-400 hover:text-indigo-600 transition-all shadow-sm">
<i class="fas fa-arrow-left"></i>
</a>
<div>
<h2 class="text-2xl font-black text-slate-800 tracking-tight">Edit Profil User</h2>
<p class="text-sm text-slate-500 font-medium italic">Perbarui informasi otoritas dan profil anggota tim.</p>
</div>
</div>
{{-- Form Section --}}
<form action="{{ route('admin.users.update', $user->id) }}" method="POST" class="bg-white border border-slate-200 rounded-[2.5rem] p-8 shadow-sm space-y-6">
@csrf
@method('PATCH')
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
{{-- Nama Lengkap --}}
<div class="space-y-2">
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Nama Lengkap</label>
<input type="text" name="name" value="{{ old('name', $user->name) }}" required
class="w-full px-4 py-3 bg-slate-50 border @error('name') border-red-500 @else border-slate-200 @enderror rounded-2xl text-sm font-bold text-slate-800 focus:ring-2 focus:ring-indigo-500 transition-all">
<x-input-error :messages="$errors->get('name')" class="mt-1" />
</div>
{{-- Email --}}
<div class="space-y-2">
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Email</label>
<input type="email" name="email" value="{{ old('email', $user->email) }}" required
class="w-full px-4 py-3 bg-slate-50 border @error('email') border-red-500 @else border-slate-200 @enderror rounded-2xl text-sm font-bold text-slate-800 focus:ring-2 focus:ring-indigo-500 transition-all">
<x-input-error :messages="$errors->get('email')" class="mt-1" />
</div>
{{-- Nomor WhatsApp --}}
<div class="space-y-2">
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Nomor WhatsApp</label>
<input type="text" name="phone" value="{{ old('phone', $user->phone) }}" placeholder="Contoh: 081234..."
class="w-full px-4 py-3 bg-slate-50 border @error('phone') border-red-500 @else border-slate-200 @enderror rounded-2xl text-sm font-bold text-slate-800 focus:ring-2 focus:ring-indigo-500 transition-all">
<x-input-error :messages="$errors->get('phone')" class="mt-1" />
</div>
{{-- Otoritas Akses (Role) - Dinamis dari Database --}}
<div class="space-y-2">
<label class="text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1">Otoritas Akses (Role)</label>
<select name="role_id" required
class="w-full px-4 py-3 bg-slate-50 border @error('role_id') border-red-500 @else border-slate-200 @enderror rounded-2xl text-sm font-black text-indigo-600 uppercase focus:ring-2 focus:ring-indigo-500 transition-all cursor-pointer">
@foreach($roles as $role)
<option value="{{ $role->id }}" {{ old('role_id', $user->role_id) == $role->id ? 'selected' : '' }}>
{{ strtoupper($role->name) }}
</option>
@endforeach
</select>
<x-input-error :messages="$errors->get('role_id')" class="mt-1" />
</div>
</div>
{{-- Info Password --}}
<div class="p-4 bg-indigo-50 rounded-2xl border border-indigo-100 flex gap-3 items-start">
<i class="fas fa-info-circle text-indigo-500 mt-1"></i>
<p class="text-[11px] text-indigo-700 leading-relaxed font-medium">
Kata sandi tidak ditampilkan di sini demi alasan keamanan. User dapat merubah kata sandi secara mandiri melalui menu <strong>Profil</strong> atau Anda dapat menggunakan fitur <em>Reset Password</em> jika diperlukan.
</p>
</div>
<div class="pt-4">
<button type="submit" class="w-full py-5 bg-slate-900 text-white text-xs font-black rounded-3xl shadow-xl hover:bg-black transition-all active:scale-[0.98] uppercase tracking-widest flex items-center justify-center gap-2">
<i class="fas fa-save"></i> Perbarui Data User
</button>
</div>
</form>
</div>
</x-app-layout>