Back to Trending
RepositoryPHP
JR

jrean/laravel-user-verification

PHP package built for Laravel to easily handle a user email verification and validate the email

861stars
111forks
4issues
3views

Laravel User Verification

A PHP package built for Laravel to easily handle user verification and email validation.

Latest Stable Version Total Downloads License

Features

  • Generate and store verification tokens for registered users
  • Send or queue verification emails with token links
  • Handle token verification process
  • Set users as verified
  • Relaunch the verification process anytime

Laravel Compatibility

Laravel VersionPackage Version
5.0.* - 5.2.*2.2
5.3.*3.0
5.4.*4.1
5.5.*5.0
5.6.*6.0
5.7.* - 5.8.*7.0
6.0.*8.0
7.0.* - 11.0.*Use master or check below:
7.0.*master
8.0.*9.0
9.0.*10.0
10.0.*11.0
11.0.*12.0
12.0.*13.0
13.0.*14.0

This package is now Laravel 13.0 compliant with v14.0.0.

Installation

Via Composer

composer require jrean/laravel-user-verification

Register Service Provider & Facade

Add the service provider to config/app.php. Make sure to add it above the RouteServiceProvider.

'providers' => [
    // ...
    Jrean\UserVerification\UserVerificationServiceProvider::class,
    // ...
    App\Providers\RouteServiceProvider::class,
],

Optionally, add the facade:

'aliases' => [
    // ...
    'UserVerification' => Jrean\UserVerification\Facades\UserVerification::class,
],

Publish Configuration

php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationServiceProvider" --tag="config"

Database Configuration

The package requires adding two columns to your users table: verified and verification_token.

Run Migrations

php artisan migrate --path="/vendor/jrean/laravel-user-verification/src/resources/migrations"

Or publish and customize the migrations:

php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationServiceProvider" --tag="migrations"

Middleware

Default Middleware

Register the included middleware in app/Http/Kernel.php:

protected $routeMiddleware = [
    // ...
    'isVerified' => \Jrean\UserVerification\Middleware\IsVerified::class,
];

Apply it to routes:

Route::group(['middleware' => ['isVerified']], function () {
    // Protected routes...
});

Custom Middleware

php artisan make:middleware IsVerified

Email Configuration

Default Email View

The package includes a basic email template. The view receives a $user variable containing user details and the verification token.

Customize Email View

Publish the views:

php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationServiceProvider" --tag="views"

The views will be available in resources/views/vendor/laravel-user-verification/.

Markdown Email Support

To use Markdown instead of Blade templates, update the user-verification.php config:

'email' => [
    'type' => 'markdown',
],

Email Sending Methods

// Send immediately
UserVerification::send($user, 'Email Verification');

// Queue for sending
UserVerification::sendQueue($user, 'Email Verification');

// Send later
UserVerification::sendLater($seconds, $user, 'Email Verification');

Usage

Routes

The package provides two default routes:

Route::get('email-verification/error', 'Auth\RegisterController@getVerificationError')->name('email-verification.error');
Route::get('email-verification/check/{token}', 'Auth\RegisterController@getVerification')->name('email-verification.check');

Required Trait

Add the VerifiesUsers trait to your registration controller:

use Jrean\UserVerification\Traits\VerifiesUsers;

class RegisterController extends Controller
{
    use RegistersUsers, VerifiesUsers;
    
    // ...
}

Integration Example

Here's a typical implementation in RegisterController.php:

public function register(Request $request)
{
    $this->validator($request->all())->validate();

    $user = $this->create($request->all());

    event(new Registered($user));

    $this->guard()->login($user);

    UserVerification::generate($user);
    UserVerification::send($user, 'Please Verify Your Email');

    return $this->registered($request, $user)
                    ?: redirect($this->redirectPath());
}

Auto-Login After Verification

Enable auto-login after verification in the config:

'auto-login' => true,

Translations

Publish translation files:

php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationServiceProvider" --tag="translations"

API Reference

Core Methods

  • generate(AuthenticatableContract $user) - Generate and save a verification token
  • send(AuthenticatableContract $user, $subject = null, $from = null, $name = null) - Send verification email
  • process($email, $token, $userTable) - Process the token verification

Model Traits

Add the UserVerification trait to your User model for these methods:

  • isVerified() - Check if user is verified
  • isPendingVerification() - Check if verification is pending

Error Handling

The package throws the following exceptions:

  • ModelNotCompliantException
  • TokenMismatchException
  • UserIsVerifiedException
  • UserNotVerifiedException
  • UserNotFoundException
  • UserHasNoEmailException

License

Laravel User Verification is licensed under The MIT License (MIT).

Similar Projects

Discover other similar projects and AI models.

RepositoryPHP
bagisto/bagisto

Open Source eCommerce & Multi-Vendor Marketplace Platform Built with Laravel for Enterprise-Scale Commerce, Supporting 10M+ SKUs

28.4k
Nov 25, 2026
RepositoryPHP
krayin/laravel-crm

Krayin CRM is Free & Open Source CRM Built with Laravel for Customer, Lead, and Sales Management.

24.2k
Nov 30, 2026
RepositoryPHP
SpartnerNL/Laravel-Excel

🚀 Supercharged Excel exports and imports in Laravel

12.7k
Dec 2, 2026
RepositoryPHP
aimeos/aimeos-laravel

Laravel ecommerce package for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce

8.7k
Nov 30, 2026
RepositoryPHP
opcodesio/log-viewer

Fast and beautiful Log Viewer for Laravel

4.4k
Jun 11, 2026
RepositoryPHP
FGRibreau/mailchecker

:mailbox: Cross-language temporary (disposable/throwaway) email detection library. Covers 55 734+ fake email providers.

1.9k
Nov 24, 2026
RepositoryPHP
atymic/twitter

Twitter API for Laravel 5.5+, 6.x, 7.x & 8.x

950
Oct 20, 2026
RepositoryPHP
daveearley/Email-Validation-Tool

An easy to use, accurate-ish & extensible email validation library for PHP 7+ 📧

280
Mar 24, 2022
RepositoryPHP
amieiro/disposable-email-domains

Disposable email domain lists, used in disposable email services, generated every quarter of an hour, in txt and JSON format.

90
Nov 18, 2026