58 lines
1.3 KiB
PHP
58 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UserUpdateRequest 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' => [
|
|
'required',
|
|
'min:2',
|
|
'max:64',
|
|
'persian_alpha'
|
|
],
|
|
'last_name' =>[
|
|
'required',
|
|
'min:3',
|
|
'max:64',
|
|
'persian_alpha'
|
|
],
|
|
'mobile' => [
|
|
'required',
|
|
'string',
|
|
'digits:11',
|
|
'unique:App\Models\User,mobile,' . auth()->id(),
|
|
'ir_mobile:zero'
|
|
],
|
|
'email' =>[
|
|
'required',
|
|
'email',
|
|
'max:150',
|
|
'unique:App\Models\User,email,' . auth()->id()
|
|
],
|
|
'password'=>[
|
|
'nullable',
|
|
'min:8',
|
|
]
|
|
];
|
|
}
|
|
}
|