feat: complete profile, editProfile

This commit is contained in:
2026-08-18 10:54:35 -07:00
parent 67963ffeb2
commit 244461f667
4 changed files with 149 additions and 0 deletions
@@ -0,0 +1,72 @@
<?php
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',
'min:2',
'max:100',
'persian_alpha',
],
'last_name' => [
'required',
'min:3',
'max:100',
'persian_alpha',
],
'email' => [
'required',
'max:150',
'email',
Rule::unique('users', 'email')->ignore(auth()->id()),
],
'mobile' => [
'required',
'ir_mobile:zero',
Rule::unique('users', 'mobile')->ignore(auth()->id()),
],
'province_id' => [
'nullable',
'exists:provinces,id',
],
'city_id' => [
'nullable',
'exists:cities,id',
],
'image' => [
'nullable',
'image',
'mimes:jpg,png,webp',
'max:800',
],
];
}
}