PHPackages                             josiasmontag/laravel-email-verification - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. josiasmontag/laravel-email-verification

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

josiasmontag/laravel-email-verification
=======================================

Laravel Email Verification

1.2.5(7y ago)626.2k↓100%9[5 issues](https://github.com/josiasmontag/laravel-email-verification/issues)MITPHPPHP &gt;=7.1.0CI failing

Since Mar 15Pushed 3y ago3 watchersCompare

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

READMEChangelog (6)Dependencies (8)Versions (9)Used By (0)

[![Build Status](https://camo.githubusercontent.com/ae86adbc68f5245d0593f421b5bd9f303cfa63789fbf7b6d1f74f7d860705231/68747470733a2f2f7472617669732d63692e6f72672f6a6f736961736d6f6e7461672f6c61726176656c2d656d61696c2d766572696669636174696f6e2e737667)](https://travis-ci.org/josiasmontag/laravel-email-verification)[![Total Downloads](https://camo.githubusercontent.com/11aaea4d33eee1f5ecfbb671c465217ad4bd7481f74db4fed6f028cca404a955/68747470733a2f2f706f7365722e707567782e6f72672f6a6f736961736d6f6e7461672f6c61726176656c2d656d61696c2d766572696669636174696f6e2f642f746f74616c2e737667)](https://packagist.org/packages/josiasmontag/laravel-email-verification)[![Latest Stable Version](https://camo.githubusercontent.com/4af819544b986ee7581c5f4b36eee95a8b3c5f25106566c3a4f1fa736da66567/68747470733a2f2f706f7365722e707567782e6f72672f6a6f736961736d6f6e7461672f6c61726176656c2d656d61696c2d766572696669636174696f6e2f762f737461626c652e737667)](https://packagist.org/packages/josiasmontag/laravel-email-verification)[![License](https://camo.githubusercontent.com/d43363949ca86fc7a5d00762a73a15b1bd2d47ea66964a2dd7e0ee349e300f6f/68747470733a2f2f706f7365722e707567782e6f72672f6a6f736961736d6f6e7461672f6c61726176656c2d656d61696c2d766572696669636174696f6e2f6c6963656e73652e737667)](https://packagist.org/packages/josiasmontag/laravel-email-verification)

> ⚠️ **Deprecation Warning**: This package is deprecated. I recommend using Laravel's [built in email verification](https://laravel.com/docs/5.8/verification).

Introduction
------------

[](#introduction)

The Laravel Email Verification package is built for Laravel 5.4 and later to easily handle a user verification and validate the e-mail. It is inspired by [crypto-based password resets](https://github.com/laravel/framework/pull/17499) and the [email verification package by jrean](https://github.com/jrean/laravel-user-verification).

- Crypto-based email verification. No need to store a temporary token in the database!
- Event based: No need to override your `register()` method.
- Using the Laravel 5.3 notification system.
- Allow certain routes for verified users only using the `IsEmailVerified` middleware.
- Let the users resend the verification email at anytime.
- Ready for Localization.

Configuration
-------------

[](#configuration)

To get started, use Composer to add the package to your project's dependencies:

```
composer require josiasmontag/laravel-email-verification

```

In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just register the `Lunaweb\EmailVerification\Providers\EmailVerificationServiceProvider` in your `config/app.php` configuration file:

```
'providers' => [
    // Other service providers...

    Lunaweb\EmailVerification\Providers\EmailVerificationServiceProvider::class,
],
```

### Migration

[](#migration)

The table representing the user must be updated with a `verified` column. This update will be performed by the migrations included with this package.

To run the migrations from this package use the following command:

```
php artisan migrate --path="/vendor/josiasmontag/laravel-email-verification/database/migrations"

```

The package tries to guess your `user` table by checking what is set in the auth providers users settings. If this key is not found, the default `App\User` will be used to get the table name.

To customize the migration, publish it with the following command:

```
php artisan vendor:publish --provider="Lunaweb\EmailVerification\Providers\EmailVerificationServiceProvider" --tag="migrations"

```

### User Model

[](#user-model)

The model representing the `User` must implement the `CanVerifyEmail` interface. The package comes with a `CanVerifyEmail` trait for a quick implementation. You can customize this trait in order to change the activation email.

```
use Illuminate\Foundation\Auth\User as Authenticatable;
use Lunaweb\EmailVerification\Traits\CanVerifyEmail;
use Lunaweb\EmailVerification\Contracts\CanVerifyEmail as CanVerifyEmailContract;

class User extends Authenticatable implements CanVerifyEmailContract
{

    use CanVerifyEmail;

    // ...
}
```

### Register Controller

[](#register-controller)

The package offers a `VerifiesEmail` trait for your `RegisterController`. You must update the middleware exception to allow `verify` routes to be access by authenticated users.

```
use Lunaweb\EmailVerification\Traits\VerifiesEmail;

class RegisterController extends Controller
{

    use RegistersUsers, VerifiesEmail;

    public function __construct()
    {
          $this->middleware('guest', ['except' => ['verify', 'showResendVerificationEmailForm', 'resendVerificationEmail']]);
          $this->middleware('auth', ['only' => ['showResendVerificationEmailForm', 'resendVerificationEmail']]);
    }

    // ...

}
```

There is no need to override `register()`. As default, the package listens for the `Illuminate\Auth\Events\Registered` event and sends the verification mail. You can disable this behavior using the `listen_registered_event` setting.

### Routes

[](#routes)

The package adds the following routes.

```
Route::get('register/verify', 'App\Http\Controllers\Auth\RegisterController@verify')->name('verifyEmailLink');
Route::get('register/verify/resend', 'App\Http\Controllers\Auth\RegisterController@showResendVerificationEmailForm')->name('showResendVerificationEmailForm');
Route::post('register/verify/resend', 'App\Http\Controllers\Auth\RegisterController@resendVerificationEmail')->name('resendVerificationEmail');
```

### Middleware

[](#middleware)

To register the IsEmailVerified middleware add the following to the `$routeMiddleware` array within the `app/Http/Kernel.php` file:

```
protected $routeMiddleware = [
    // …
    'isEmailVerified' => \Lunaweb\EmailVerification\Middleware\IsEmailVerified::class,
```

Apply the middleware on your routes:

```
Route::group(['middleware' => ['web', 'auth', 'isEmailVerified']], function () {
    …
```

### Events

[](#events)

The package emits 2 events:

- `Lunaweb\EmailVerification\Events\EmailVerificationSent`
- `Lunaweb\EmailVerification\Events\UserVerified`

### Resend the verification mail

[](#resend-the-verification-mail)

Using the `isEmailVerified` Middleware, the following form is shown to the user. It allows the user to correct his email address and resend the verification mail.

[![Screenshot](https://user-images.githubusercontent.com/1945577/27735164-7b316630-5d9e-11e7-86f6-8922a2488cfb.png)](https://user-images.githubusercontent.com/1945577/27735164-7b316630-5d9e-11e7-86f6-8922a2488cfb.png)

You can manually point the user to this form using the `showResendVerificationEmailForm` route (Default: `register/verify/resend`).

To programmatically resend the verification mail:

```
$this->app->make('Lunaweb\EmailVerification\EmailVerification')->sendVerifyLink($user);
```

### Customize the verification mail

[](#customize-the-verification-mail)

Therefore, override `sendEmailVerificationNotification()` of your User model. Example:

```
class User implements CanVerifyEmailContract
{

    use CanVerifyEmail;

    /**
     * Send the email verification notification.
     *
     * @param  string  $token   The verification mail reset token.
     * @param  int  $expiration The verification mail expiration date.
     * @return void
     */
    public function sendEmailVerificationNotification($token, $expiration)
    {
        $this->notify(new MyEmailVerificationNotification($token, $expiration));
    }
}
```

### Customize the resend form

[](#customize-the-resend-form)

```
php artisan vendor:publish --provider="Lunaweb\EmailVerification\Providers\EmailVerificationServiceProvider" --tag="views"

```

The template can be found in `resources/views/vendor/emailverification/resend.blade.php`

### Customize the messages / localization

[](#customize-the-messages--localization)

```
php artisan vendor:publish --provider="Lunaweb\EmailVerification\Providers\EmailVerificationServiceProvider" --tag="translations"

```

The localization files can be found in `resources/lang/vendor/emailverification`

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 80.4% of commits — single point of failure

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 ~102 days

Total

8

Last Release

2630d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.6.4

1.2.5PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/07b14ffb44d0a4e799d313482990b85e88f70d0f1a3bdbb9189134c499c4e695?d=identicon)[josiasmontag](/maintainers/josiasmontag)

---

Top Contributors

[![josiasmontag](https://avatars.githubusercontent.com/u/1945577?v=4)](https://github.com/josiasmontag "josiasmontag (37 commits)")[![Yahav](https://avatars.githubusercontent.com/u/113236?v=4)](https://github.com/Yahav "Yahav (4 commits)")[![tominon](https://avatars.githubusercontent.com/u/508519?v=4)](https://github.com/tominon "tominon (2 commits)")[![antonzapevalov](https://avatars.githubusercontent.com/u/6674242?v=4)](https://github.com/antonzapevalov "antonzapevalov (1 commits)")[![daneswood-matt](https://avatars.githubusercontent.com/u/48827439?v=4)](https://github.com/daneswood-matt "daneswood-matt (1 commits)")[![Dylan-DPC](https://avatars.githubusercontent.com/u/99973273?v=4)](https://github.com/Dylan-DPC "Dylan-DPC (1 commits)")

---

Tags

email-validationemail-verificationlaravellaravel-5-packagelaravel-packagelaravel5laravel54user-validationuser-verification

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/josiasmontag-laravel-email-verification/health.svg)

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[laragear/two-factor

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

339785.3k8](/packages/laragear-two-factor)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

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