Zizaco / confide

Confide is a authentication solution for Laravel 4
1.19k stars 258 forks source link

Username not accepting "." #546

Open webmastervinay opened 9 years ago

webmastervinay commented 9 years ago

Hello,

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

Can you please fix this bug?

stefanzweifel commented 9 years ago

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',
        ]
    ];

}