fix: update user side
This commit is contained in:
@@ -2,47 +2,31 @@
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class EditProfilePostRequest 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',
|
||||
'persian_alpha',
|
||||
'min:2',
|
||||
'max:100',
|
||||
'persian_alpha',
|
||||
],
|
||||
|
||||
'last_name' => [
|
||||
'required',
|
||||
'persian_alpha',
|
||||
'min:3',
|
||||
'max:100',
|
||||
'persian_alpha',
|
||||
],
|
||||
|
||||
'email' => [
|
||||
'required',
|
||||
'max:150',
|
||||
'email',
|
||||
Rule::unique('users', 'email')->ignore(auth()->id()),
|
||||
],
|
||||
|
||||
'mobile' => [
|
||||
@@ -51,21 +35,36 @@ class EditProfilePostRequest extends FormRequest
|
||||
Rule::unique('users', 'mobile')->ignore(auth()->id()),
|
||||
],
|
||||
|
||||
'province_id' => [
|
||||
'nullable',
|
||||
'exists:provinces,id',
|
||||
'email' => [
|
||||
'required',
|
||||
'email',
|
||||
'max:150',
|
||||
Rule::unique('users', 'email')->ignore(auth()->id()),
|
||||
],
|
||||
|
||||
'city_id' => [
|
||||
'province' => [
|
||||
'nullable',
|
||||
'exists:cities,id',
|
||||
'string',
|
||||
'max:100',
|
||||
],
|
||||
|
||||
'image' => [
|
||||
'city' => [
|
||||
'nullable',
|
||||
'image',
|
||||
'mimes:jpg,png,webp',
|
||||
'max:800',
|
||||
'string',
|
||||
'max:100',
|
||||
],
|
||||
|
||||
'current_password' => [
|
||||
'nullable',
|
||||
'current_password',
|
||||
],
|
||||
|
||||
'new_password' => [
|
||||
'nullable',
|
||||
'string',
|
||||
'min:6',
|
||||
'max:255',
|
||||
'confirmed',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user