Add admin user edit flow

This commit is contained in:
2026-05-22 13:07:20 +00:00
parent d13e919310
commit a810f54153
8 changed files with 362 additions and 43 deletions
@@ -0,0 +1,35 @@
<?php
namespace App\Http\Requests\Admin;
use App\Concerns\ProfileValidationRules;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Password;
class UpdateManagedUserRequest extends FormRequest
{
use ProfileValidationRules;
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return $this->user()?->can('access-admin') ?? false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
...$this->profileRules($this->route('user')?->id),
'must_change_password_on_next_login' => ['required', 'boolean'],
'password' => ['nullable', 'string', Password::default(), 'confirmed'],
];
}
}