Wednesday, February 21, 2018

inconsistent email format of html input field with laravel email validation - development

inconsistent email format of html input field with laravel email validation

In my blade file i have a html form for user in which input field email have type email. But i think it provide inconsistent email format validation. example it show abc@xyz and abc@xyz.com both are correct email address but in my controller, validator method return me invalid email format for abc@xyz. How can i resolve this issue???

In my blade file:

<input type="email" name="email" value="">

And in my controller:

$validator = Validator::make($request->all(), [
     'email'       => 'email|unique:table_name,col_name',
    ],[
     'email.unique' => 'email is already in used',
   ]);

if ($validator->fails()) {
    return redirect()->back()->withInput($request->all())->withErrors($validator);
  }



from Laravel Questions and Answers https://laravelquestions.com/html/inconsistent-email-format-of-html-input-field-with-laravel-email-validation/
via Lzo Media

No comments:

Post a Comment