feat: implement admin user management interface and routes for CRUD operations and password resets

This commit is contained in:
jeremy bayse
2026-04-14 18:17:33 +02:00
parent e68108a2b1
commit 4a137fc511
3 changed files with 27 additions and 1 deletions

View File

@@ -94,4 +94,18 @@ class UserController extends Controller
return back()->with('success', 'Administrateur supprimé.');
}
public function resetPassword(User $user)
{
if (!auth()->user()->isSuperAdmin()) {
abort(403, 'Unauthorized action.');
}
$password = Str::random(10);
$user->update([
'password' => Hash::make($password)
]);
return back()->with('success', 'Nouveau mot de passe généré pour ' . $user->name . ' : ' . $password);
}
}