67 lines
1.5 KiB
PHP
67 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Account;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class EditProfileUpdateRequest 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',
|
|
'ir_mobile:zero'
|
|
],
|
|
'email' => [
|
|
'required',
|
|
'email',
|
|
'max:150',
|
|
'unique:App\Models\User,email,' . auth()->id()
|
|
],
|
|
'province_id' => [
|
|
'nullable',
|
|
'exists:provinces,id'
|
|
],
|
|
'city_id' => [
|
|
'nullable',
|
|
'exists:cities,id'
|
|
],
|
|
'avatar' => [
|
|
'nullable',
|
|
'image',
|
|
'mimes:jpeg,png,jpg,webp',
|
|
'max:800'
|
|
]
|
|
|
|
];
|
|
}
|
|
}
|