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):

<?php

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


Newsletter

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

Laravel News Partners

Laravel Jobs

Software Engineer Lead (PHP)
Remote
CivicPlus, LLC
Full-time Senior Web Developer
Detroit, MI
Wayne State University
Senior Software Engineer
Sydney, Australia
FoodByUs
Full Stack Engineer
Remote or Medford, Oregon
Empire Medical
Laravel Developer (fulltime - Dutch only)
Netherlands
Qbixx | Webservices
Full Stack or Back-End Developer
Alexandria, VA; Tallahassee, FL; Orlando, FL
Marketing for Change
Senior Quality Assurance Engineer
Remote
Bisnow Media