<?php

namespace App\Http\Requests;


use App\Rules\ReCaptcha;
use Illuminate\Validation\Rule;

class CreateAccountRequest extends ApiBaseRequest
{

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'first_name'=>'required|regex:'.$this->script_validation_rule,
            'last_name'=>'required|regex:'.$this->script_validation_rule,
            'email'=>['required', 'email',Rule::unique('users', 'email')->withoutTrashed()],
            'password'=>'required|min:8',
            'captcha'=>['required']
        ];

    }
    public function  messages()
    {
        return [
            'password.min' => 'Password must be 8 characters',
            'password.regex' => 'Password must be 8 characters and include a capital, lowercase, number and symbol'
        ];
    }
}
