confide icon indicating copy to clipboard operation
confide copied to clipboard

Username not accepting "."

Open webmastervinay opened this issue 9 years ago • 1 comments

Hello,

I was trying to create a new user with username included ".", It gives error as below image

Can you please fix this bug?

webmastervinay avatar Aug 17 '15 02:08 webmastervinay

This issue probably accours, because confide doesn't allow "." in a username by default.

You can simple create your own validation class and bind it to the IoC-Container. How-to-Guide.

You can override the rules by simply extending the original UserValidator Class like so:

<?php

use Zizaco\Confide\UserValidator;
use Zizaco\Confide\UserValidatorInterface;

class CustomConfideValidator extends UserValidator
{

    public $rules = [
        'create' => [
            'username' => 'string',
            'email'    => 'required|email',
            'password' => 'required|min:4',
        ],
        'update' => [
            'username' => 'string',
            'email'    => 'required|email',
            'password' => 'required|min:4',
        ]
    ];

}

stefanzweifel avatar Aug 19 '15 13:08 stefanzweifel