Laravel 8 Custom Email Verification System

In this tutorial you will learn about the Laravel 8 Custom Email Verification System and its application with practical example.

In this Laravel 8 Custom Email Verification System Tutorial I will show you how to implement custom email verification for newly registered users in laravel. In this tutorial you will learn to enable custom email verification for account activation in laravel. Laravel comes with built-in email verification system for newly registered user. Using this, newly registered user will get an email with an account activation link. This activation link is used for account verification. When activation link is clicked, this will make user account verified and active for the application. Once user account is activated then it will be allowed to access protected routes; which can be accessible only by verified accounts.

Laravel 8 Custom Email Verification System

In this step by step tutorial, we’ll show you how to setup custom email verification system for newly registered user in laravel. Please follow the instruction given below:

  • Step 1 – Install Laravel 8 App
  • Step 2 – Configuration Database and Email
  • Step 3 – Install Laravel UI
  • Step 4 – Install Bootstrap Auth Scaffolding
  • Step 5 – Install Npm Packages
  • Step 6 – Run PHP artisan Migrate
  • Step 7 – Configure Model, Route And Controller
  • Step 8 – Run Development Server

Step 1 – Install Laravel 8 App

First of all we need to create a fresh laravel project, download and install Laravel using the below command

Step 2 – Configuration Database and Email

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Now we will setup SMTP credential in .env to send emails. We are using mailtrap SMTP credential in this example.

Step 3 – Install Laravel UI

In this step we will install laravel ui package using following command:

Step 4 – Install Bootstrap Auth Scaffolding

Now we need to enable bootstrap authentication scaffolding in laravel.

Step 5 – Install Npm Packages

Now we will instal npm dependencies using following command:

Then type the following command on cmd to run npm:

Step 6 – Run php artisan Migrate

Now, run the migration to create database table using following artisan command:

Step 7 – Configure Model, Route And Controller

Visit app/Models and open User.php file and add the following code into it:

Then visit routes directory and open web.php and add the following rotues into it:

Aftert that, visit app/Http/Controllers and open HomeController.php and add the following code into it:

Step 8 – Run Development Server

Now we are ready to run our example so lets start the development server using following artisan command –

Now, open the following URL in browser to see the output –

In this tutorial we have learn about the Laravel 8 Custom Email Verification System and its application with practical example. I hope you will like this tutorial.