This website collects cookies to deliver better user experience
Email Verification After User Registration In Laravel
Email Verification After User Registration In Laravel
How to verify user after registration?
In this blog post, we will learn how to implement email verification after user registration. We will implement this in three simple steps with the help of this post.
No matter if you have laravel/ui authentication or laravel/breeze authentication or any simple authentication you are using. In both authentication you just have to follow these steps.
Step #01: Create Or Open Laravel App:
Go to the user model App\Model\User.php
Implements MustVerifyEmail interface in User class
Include Destination
use Illuminate\Contracts\Auth\MustVerifyEmail;
Implements Interface
class User extends Authenticatable implements MustVerifyEmail
Step #02: Now let's assign middleware to the routes
Middleware you have to assign is the **verified middleware**
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth','twofactor','verified'])>name('dashboard');
Step # 03: Use Email Testing Tool
You can use mailtrap.io or any email testing tool.
1. First Create Your Inbox
Now, let's go to the smtp settings and copy laravel details..