42 lines
1.8 KiB
PHP
42 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class ProfileUpdateRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'name' => ['required', 'string', 'max:255'],
|
|
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)],
|
|
'national_id' => ['nullable', 'string', 'max:50'],
|
|
'phone' => ['nullable', 'string', 'max:50'],
|
|
'phone_home' => ['nullable', 'string', 'max:50'],
|
|
'phone_fax' => ['nullable', 'string', 'max:50'],
|
|
'birth_date' => ['nullable', 'date'],
|
|
'gender' => ['nullable', 'in:male,female,other'],
|
|
'identity_type' => ['nullable', 'in:patient,parent,social,other'],
|
|
'identity_other_text' => ['nullable', 'string', 'max:255', 'required_if:identity_type,other'],
|
|
'occupation' => ['nullable', 'string', 'max:120'],
|
|
'employer' => ['nullable', 'string', 'max:255'],
|
|
'job_title' => ['nullable', 'string', 'max:120'],
|
|
'address_line_1' => ['nullable', 'string', 'max:255'],
|
|
'address_line_2' => ['nullable', 'string', 'max:255'],
|
|
'city' => ['nullable', 'string', 'max:120'],
|
|
'postal_code' => ['nullable', 'string', 'max:20'],
|
|
'emergency_contact_name' => ['nullable', 'string', 'max:255'],
|
|
'emergency_contact_phone' => ['nullable', 'string', 'max:50'],
|
|
'profile_photo' => ['nullable', 'image', 'max:2048'],
|
|
];
|
|
}
|
|
}
|