Saturday, March 11, 2017

Validation of Email

I have been testing the laravel validations and I have encountered a problem with the email.

When registering with an invalid email, such as 'example@ho.com', 'a@a.com', 'x@hot.com', etc. Log me in and it does not give me any error .. how can I arrange to just ask for a valid email?

    protected function validator(array $data)
    {
    return Validator::make($data, [
        'name' => 'required|Regex:/^[\D]+$/i|max:100',
        'last_name' => 'required|Regex:/^[\D]+$/i|max:100',
        'email' => 'required|email|max:255|unique:users',
        'password' => 'required|min:6|confirmed',
    ]);
   }

I've been following the tutorial

http://www.lubus.in/blog/adding-email-verification-in-laravel-5-3-app-149

But I was getting an error with the router and then I decided to undo all the changes. Any idea?

FatalThrowableError in web.php line 14: Parse error: syntax error, unexpected '{'

line14

Route::get(‘register/verify/{token}’, ‘Auth\RegisterController@verify’);



via basosneo

Advertisement