Sunday, March 19, 2017

Email validation not working properly. Laravel

I'm facing some problems with my email validation. Even if i enter valid email address, it shows 'The email must be a valid email address'. I think its due to spaces. My syntax are below:

$rules = array(
        'fname'             => 'required|regex:/^[\pL\s\-]+$/u',   
        'lname'             => 'required|regex:/^[\pL\s\-]+$/u',  
        'address'             => 'required',  
        'email'            => 'required|email',     // required 
        'password'         => 'required|min:8',
        'password2' => 'required|same:password'           // required and has to match the password field
    );

Can anyone give me solutions?



via Anon

Advertisement