0
votes

I have the following rules:

$rules = array(
                'name'          => 'required|alpha_num|unique:users,username',
                'password'      => 'required|min:6|confirmed',
                'email'         => 'required|email|unique:users'
            );

unique checks for existing emails properly, HOWEVER, if I input an invalid email address (something like kolę@ddd.com) I get a "Woops, something went wrong" laravel error. It seems that the validation doesn't stop at the email rule and the wrong email address is being passed to the unique rule. If I remove the unique rule it works properly, but doesn't check if a certain email exists. How do I solve this?

1
kolę@ddd.com is a valid emailMohamed Bouallegue
But the validator still fails. Why is that?Onion
So what's is the issue here? the email provided is valid, so validator should pass, unless it's already in the database.Jarek Tkaczyk
The validator fails when I provide that email. That's the issue.Onion

1 Answers

0
votes

I've found out what was causing the validator to fail: mysql table row collation.

I've set it to utf8-general-ci and it's all working now.