<?php

namespace App\Http\Requests\Auth;

use Illuminate\Foundation\Http\FormRequest;

class CompleteProfileRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user() !== null;
    }

    public function rules(): array
    {
        return [
            'mobile' => ['nullable', 'regex:/^09\\d{9}$/'],
            'national_code' => ['nullable', 'string', 'max:20'],
            'father_mobile' => ['nullable', 'regex:/^09\\d{9}$/'],
            'mother_mobile' => ['nullable', 'regex:/^09\\d{9}$/'],
            'home_phone' => ['nullable', 'string', 'max:30'],
            'address' => ['nullable', 'string', 'max:1000'],
        ];
    }
}
