2024-08-30 03:31:22 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
|
|
|
|
use App\Models\User;
|
|
|
|
use App\Rules\ZxcvbnRule;
|
|
|
|
use Illuminate\Validation\Rules\Password;
|
|
|
|
|
|
|
|
class UserEditRequest extends AuthorizedRequest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
*
|
|
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
|
|
*/
|
|
|
|
public function rules(): array
|
|
|
|
{
|
|
|
|
return [
|
2024-08-30 09:49:54 +02:00
|
|
|
'last_name' => ['string'],
|
|
|
|
'name' => ['string'],
|
|
|
|
'middle_name' => ['string'],
|
|
|
|
'email' => ['email'],
|
|
|
|
'phone' => ['string', 'regex:'.User::PHONE_REGEX],
|
2024-08-30 09:40:57 +02:00
|
|
|
'password' => [Password::min(1)->rules([new ZxcvbnRule])],
|
2024-08-30 03:31:22 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|