In this tutorials of Laravel, we will show you how to enable Laravel 8 Email Verification via Breeze package.
composer create-project laravel/laravel email-verification
cd email-verification
composer require laravel/breeze --dev
php artisan breeze:install
Path: app/Models/User.php, update class User extends Authenticatable to class User extends Authenticatable implements MustVerifyEmail. In below User Model we implemented MustVerifyEmail interface on User class.
<?php
namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable implements MustVerifyEmail
{
use HasApiTokens, HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/ protected $fillable = [
'name',
'email',
'password',
];
Here in web.php file, we add ‘verified’ in middleware.
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth','verified'])->name('dashboard');
php artisan migrate
A list of the best spas in Dubai that will relax your body and mind…
Canada is a majestically beautiful country full of natural wonders and is also home to…
Here is a list of the Best USA Makeup Brands in 2023, that are safe…
Here is a list of the Best Australian Makeup Brands in 2023, that are safe…
Content creators always try hard to make their content reach a large number of followers…
Truck companies are constantly searching for people to fulfill their logistics, transportation, and supply chain…