app/Http/Controllers/Auth/RegisterController.php
/**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
Get a validator for an incoming registration request.
@param  array  $data
@return \Illuminate\Contracts\Validation\Validator
Get a validator for an incoming registration request . @param array $data @return \ Illuminate \ Contracts \ Validation \ Validator
protected function validator(array $data)
    {
        $messages = [
            'unique' => 'This :attribute is already registered. You might want to <span><a href="#login-form" data-toggle="modal" id="reg-login-modal" data-dismiss="modal">login</a></span>',
            'min' => 'Password is weak, should atleast be 6 characters'
        ];
         $vaild =   Validator::make($data, [
            'firstname' => 'required|max:255',
            'lastname' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'password' => 'required|min:6',
            'birthdate_month' => 'required|max:255',
            'birthdate_day' => 'required|max:255',
            'birthdate_year' => ['required', new greaterThan],
        ],$messages);
        if($vaild->fails()){
            return json_encode($vaild->errors());
        }
        return true;
    }
protected function validator ( array $ data ) { $ messages = [ 'unique' => 'This :attribute is already registered. You might want to <span><a href="#login-form" data-toggle="modal" id="reg-login-modal" data-dismiss="modal">login</a></span>' , 'min' => 'Password is weak, should atleast be 6 characters' ] ; $ vaild = Validator :: make ( $ data , [ 'firstname' => 'required|max:255' , 'lastname' => 'required|max:255' , 'email' => 'required|email|max:255|unique:users' , 'password' => 'required|min:6' , 'birthdate_month' => 'required|max:255' , 'birthdate_day' => 'required|max:255' , 'birthdate_year' => [ 'required' , new greaterThan ] , ] , $ messages ) ; if ( $ vaild -> fails ( ) ) { return json_encode ( $ vaild -> errors ( ) ) ; } return true ; }
Get a validator for an incoming registration request.
Get a validator for an incoming registration request .