Add User Email Confirmation to Your Laravel Projects

Add User Email Confirmation to Your Laravel Projects

If you want to add an email verification step to user registration in your Laravel Projects, Marcel Pociot has a new package aptly named laravel-confirm-email. New users are required to confirm their registration through an email to proceed.

The package works by providing two traits that replace the AuthenticatesUsers and RegistersUsers that come with Laravel. After registering, users are required to confirm their account via email.

To get started, install the package via Composer:

composer require beyondcode/laravel-confirm-email

This package requires a database migration, which you need to get by running the vendor:publish command:

php artisan vendor:publish --provider=BeyondCode\EmailConfirmation\EmailConfirmationServiceProvider

You’ll also need to add two new routes to handle the confirmations, and the package also comes with a language file that you can tweak as well as a configurable notification class used (if you publish the config):


return [
    | Notification
    | This is the notification class that will be sent to users when they receive
    | a confirmation code.
    'notification' => \BeyondCode\EmailConfirmation\Notifications\ConfirmEmail::class,

Learn more about this package by checking out the Official GitHub repository and follow the readme for complete installation and usage instructions.

Filed in: News


Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

PHP Web Developer
Orlando, FL
Christ for all Nations
PHP Developer
Manhattan, KS (open to Remote)
Mid-Senior Laravel Developer
Optix Solutions
Full Stack Web Developer
Las Vegas, NV
V Shred
Staff Software Engineer (Laravel)
Software Engineer (PHP, Laravel, Vue)
Los Angeles, CA
Software Engineer Level 1 / Level 2
St. Pete. / Tampa Area, FL / Remote