feat: implement users edit request in admin panel

This commit is contained in:
2026-08-19 15:40:38 -07:00
parent 937eb74d60
commit 2f563f7e4d
2 changed files with 156 additions and 0 deletions
@@ -0,0 +1,62 @@
<?php
namespace App\Http\Requests\Admin\Users;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UserEditRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'first_name' => [
'nullable',
'min:2',
'max:100',
'persian_alpha',
],
'last_name' => [
'nullable',
'min:3',
'max:100',
'persian_alpha',
],
'email' => [
'nullable',
'max:150',
'email',
Rule::unique('users', 'email')->ignore($this->route('user'))
],
'mobile' => [
'nullable',
'ir_mobile:zero',
Rule::unique('users', 'mobile')->ignore($this->route('user'))
],
'password' => [
'nullable',
'string',
'min:6',
'max:255',
]
];
}
}