How to check email is valid or not in Laravel

Created at 18-May-2021 , By samar

How to check email is valid or not in Laravel

In this tutorial, we will try to find the solution to "How to check email is valid or not in Laravel" through programming.

Laravel provides validation rules to validate input fields. You can check if an email is valid or not in Laravel using the validate method by passing the validation rules.
  • Laravel email validation with required, valid email format and unique value rules

    //Inside controller’s method
    
    $request->validate([
        'email' => 'required|email|unique:users,email'
    ]);
    

    You can use validate method and pass validation rules to it. Here we pass rules required for mandatory, email for valid email format, unique:users, email that specifies the user's table with a unique value for email column. 

Back to code snippet queries related laravel

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.