Making Sense of Laravel 7/6 Email Verification with Mailtrap

Laravel 7/6 Email Verification Example | Laravel Signup Verification Link to Email with Example

Laravel 7/6 Email Verification | Mailtrap Cofiguration [ Explained

              In this article we will how can Laravel send email verification after registration with example . For this example we will for verification . Let me tell you first that it's very easy to do email verification with Laravel , you just need to do some following changes on your project .

              After registration it will send a verification email to your corresponding registration email and it will show a message that " Before proceeding, please check your email for a verification link. If you did not receive the email " since you have not verify your email .

             Let's see the steps for Laravel Email Verification ..

Step-1 : Setup your Laravel Project :

            Firstly Download your Laravel project and setup the authentication for your project which is already provided by Laravel . Use the following commands to create a Laravel project and implementing Login and Signup authentication in it

composer create-project --prefer-dist laravel/laravel project-name

cd project-name

composer require laravel/ui

php artisan ui vue --auth

npm install

     After that setup your database in your project .

Step-2 : Setting up Mail Configuration ( Mailtrap ) :

      The next step is to setup Mail credential on in your Laravel project . Make the following mail configuration on your projects ' .env ' file according to your mailtrap credential as shown below . For detail information you can also read Laravel 7 Authentication .

Mailtrap credentials :

Laravel 7/6 Email Verification | Mailtrap Cofiguration [ Explained

Project-name\.env.php :







Step-3 : Make following change on your file :

Project-name\app\User.php :

        On User.php implement the following class

class User extends Authenticatable implements MustVerifyEmail

Laravel 7/6 Email Verification | Mailtrap Cofiguration [ Explained

Project-name\routes\web.php :

      In web.php make the following changes


Route::get('/home', 'HomeController@index')->name('home')->middleware('verified');

Laravel 7/6 Email Verification | Mailtrap Cofiguration [ Explained

Step-4 : Final Step :

    Now use the following command on your terminal otherwise it might show you an error " cannot send message without a sender address " .

php artisan config:cache

            This is it now your project is ready for mail verification .Now on new Signup / Registration it will send you a verification message on your mailtrap id like the following .

Laravel 7/6 Email Verification | Mailtrap Cofiguration [ ExplainedLaravel 7/6 Email Verification | Mailtrap Cofiguration [ Explained

       You have to verify your mail in order to login . So this article is all about how can you send verification email on Signup / Registration . Hope this article will helpful to you .

Thank you for reading this article 😊

For any query do not hesitate to comment below 💬

Also Read :-

Why Laravel is so Popular ?

Add Date-Time Picker in Laravel

How to use Laravel Authentication

How to make Covid-19 Tracker

How to use Laravel SweetAlert

How to use Pagination in Laravel

How to use Vue JS in Laravel

Previous Post Next Post

Contact Form