PHPackages                             beyondcode/laravel-confirm-email - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. beyondcode/laravel-confirm-email

ActiveLibrary

beyondcode/laravel-confirm-email
================================

Add email verification to your Laravel projects.

2.5.0(1mo ago)55255.8k↓39.7%55MITPHPPHP ^7.3|^8.0

Since Apr 30Pushed 1y ago14 watchersCompare

[ Source](https://github.com/beyondcode/laravel-confirm-email)[ Packagist](https://packagist.org/packages/beyondcode/laravel-confirm-email)[ Docs](https://github.com/beyondcode/laravel-confirm-email)[ RSS](/packages/beyondcode-laravel-confirm-email/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (19)Used By (0)

Laravel Email Confirmation
==========================

[](#laravel-email-confirmation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e14a60002e6875872f3412a7c11d19bf577017d34affa7fc6282b4236ce2b4f7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6265796f6e64636f64652f6c61726176656c2d636f6e6669726d2d656d61696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/beyondcode/laravel-confirm-email)[![Total Downloads](https://camo.githubusercontent.com/1463bd66a82d4ff863f3e3924f67217a19ccf97c72e0f712ffb9071796b7d9fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6265796f6e64636f64652f6c61726176656c2d636f6e6669726d2d656d61696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/beyondcode/laravel-confirm-email)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require beyondcode/laravel-confirm-email
```

Usage
-----

[](#usage)

This package adds a `confirmed_at` and `confirmation_code` field to your users table. Publish the migration and the configuration file using

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

And run the migrations:

```
php artisan migrate
```

### Configuring the login, register and forgot password controllers

[](#configuring-the-login-register-and-forgot-password-controllers)

In order to make use of the email verification, replace the `AuthenticatesUsers`, `RegistersUsers` and the `SendsPasswordResetEmails` traits that come with Laravel, with the ones provided by this package.

These traits can be found in these three files:

- `App\Http\Controllers\Auth\LoginController`
- `App\Http\Controllers\Auth\RegisterController`
- `App\Http\Controllers\Auth\ForgotPasswordController`

### Add the confirmation and resend routes

[](#add-the-confirmation-and-resend-routes)

Add the following two routes to your `routes/web.php` file:

```
Route::name('auth.resend_confirmation')->get('/register/confirm/resend', 'Auth\RegisterController@resendConfirmation');
Route::name('auth.confirm')->get('/register/confirm/{confirmation_code}', 'Auth\RegisterController@confirm');
```

### Show confirmation messages

[](#show-confirmation-messages)

This packages adds some flash messages that contain error/information messages for your users. To show them to your users, add this to your `login.blade.php`:

```
@if (session('confirmation'))

        {!! session('confirmation') !!}

@endif
```

and this to both your `login.blade.php` and `email.blade.php`

```
@if ($errors->has('confirmation') > 0 )

        {!! $errors->first('confirmation') !!}

@endif
```

### Customization

[](#customization)

This package comes with a language file, that allows you to modify the error / confirmation messages that your user might see. In addition to that, you can change the notification class that will be used to send the confirmation code completely, by changing it in the `config/confirmation.php` file.

### Change redirect routes

[](#change-redirect-routes)

You can change all possible redirect routes by including these values either as properties in your registration controller, or as methods returning the route/URL string:

- `redirectConfirmationTo`
- `redirectAfterRegistrationTo`
- `redirectAfterResendConfirmationTo`

They all default to `route('login')`.

### The Confirmed Event

[](#the-confirmed-event)

On successful email confirmation, this package dispatches a `Confirmed` event, in order for you to conveniently handle any custom logic, such as sending a welcome email or automatically logging the user in.

Simply add the `Confirmed` event, and your listeners, to the `EventServiceProvider` in your application:

```
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        'BeyondCode\EmailConfirmation\Events\Confirmed' => [
            'App\Listeners\YourOnConfirmedListener'
        ]
    ];
```

For more information about registering events and listeners, please refer to the [Laravel docs](https://laravel.com/docs/events#registering-events-and-listeners).

Catch, test and debug application mails with Laravel Herd
---------------------------------------------------------

[](#catch-test-and-debug-application-mails-with-laravel-herd)

Laravel Herd provides an integrated local email service, streamlining the process of testing and debugging application emails. The email service organizes emails into distinct inboxes for each application, ensuring they are easily accessible and simple to locate.

[herd.laravel.com](https://herd.laravel.com)

[![image](https://private-user-images.githubusercontent.com/26432041/420261151-6417907c-119d-43ac-9cf6-5638bafae24f.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM3Njc2NzcsIm5iZiI6MTc3Mzc2NzM3NywicGF0aCI6Ii8yNjQzMjA0MS80MjAyNjExNTEtNjQxNzkwN2MtMTE5ZC00M2FjLTljZjYtNTYzOGJhZmFlMjRmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzE3VDE3MDkzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ5ZTVjMTZmN2ZiNWM5ZjI3YmQwNjIyYTdhMzM3YjZlZTY1MTM4MTY2ZGZlYjQxMjQ1MTAxZGJmODYzY2Y1NDUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Bi3mul4ucdLEpaJY_jl_bWdAeb03oBZ9n2j1eK_LnqM)](https://private-user-images.githubusercontent.com/26432041/420261151-6417907c-119d-43ac-9cf6-5638bafae24f.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM3Njc2NzcsIm5iZiI6MTc3Mzc2NzM3NywicGF0aCI6Ii8yNjQzMjA0MS80MjAyNjExNTEtNjQxNzkwN2MtMTE5ZC00M2FjLTljZjYtNTYzOGJhZmFlMjRmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzE3VDE3MDkzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ5ZTVjMTZmN2ZiNWM5ZjI3YmQwNjIyYTdhMzM3YjZlZTY1MTM4MTY2ZGZlYjQxMjQ1MTAxZGJmODYzY2Y1NDUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Bi3mul4ucdLEpaJY_jl_bWdAeb03oBZ9n2j1eK_LnqM)

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Marcel Pociot](https://github.com/mpociot)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance65

Regular maintenance activity

Popularity51

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~221 days

Recently: every ~443 days

Total

14

Last Release

56d ago

Major Versions

1.6.1 → 2.0.02020-07-02

PHP version history (2 changes)1.0.0PHP ^7.1

2.1.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/863e91ca13b8c4031f202c0eee4f06b3a4352f92cf9cd397b03609b20247ed16?d=identicon)[beyondcode](/maintainers/beyondcode)

---

Top Contributors

[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (25 commits)")[![mechelon](https://avatars.githubusercontent.com/u/26432041?v=4)](https://github.com/mechelon "mechelon (10 commits)")[![rickwest](https://avatars.githubusercontent.com/u/24735291?v=4)](https://github.com/rickwest "rickwest (9 commits)")[![sschlein](https://avatars.githubusercontent.com/u/2911113?v=4)](https://github.com/sschlein "sschlein (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![BrandonSurowiec](https://avatars.githubusercontent.com/u/5625680?v=4)](https://github.com/BrandonSurowiec "BrandonSurowiec (1 commits)")[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (1 commits)")[![chapeupreto](https://avatars.githubusercontent.com/u/834048?v=4)](https://github.com/chapeupreto "chapeupreto (1 commits)")[![colinmackinlay](https://avatars.githubusercontent.com/u/7833362?v=4)](https://github.com/colinmackinlay "colinmackinlay (1 commits)")[![kslr](https://avatars.githubusercontent.com/u/5516323?v=4)](https://github.com/kslr "kslr (1 commits)")

---

Tags

beyondcodelaravel-confirm-email

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/beyondcode-laravel-confirm-email/health.svg)

```
[![Health](https://phpackages.com/badges/beyondcode-laravel-confirm-email/health.svg)](https://phpackages.com/packages/beyondcode-laravel-confirm-email)
```

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[beyondcode/laravel-mailbox

Handle incoming emails in your Laravel application.

1.1k1.0M4](/packages/beyondcode-laravel-mailbox)[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
