PHPackages                             jeremykenedy/laravel2step - 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. jeremykenedy/laravel2step

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

jeremykenedy/laravel2step
=========================

Laravel 2 Step Authentication Package

V4.0.0(7mo ago)284107.7k↓28.4%48MITPHPPHP ^7.3|^8.0|^8.1|^8.2|^8.3CI failing

Since Jan 19Pushed 7mo ago11 watchersCompare

[ Source](https://github.com/jeremykenedy/laravel2step)[ Packagist](https://packagist.org/packages/jeremykenedy/laravel2step)[ GitHub Sponsors](https://github.com/jeremykenedy)[ Patreon](https://www.patreon.com/jeremykenedy)[ RSS](/packages/jeremykenedy-laravel2step/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (26)Used By (0)

[![Laravel 2 Step Verification](https://camo.githubusercontent.com/1df39171a43ed1e0874861eefee66d89884f2a3601acd48e0bbf7dbc7e333e6f/68747470733a2f2f6769746875622d70726f6a6563742d696d616765732e73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6c6f676f732f6c61726176656c32737465702d6c6f676f2e706e67)](https://camo.githubusercontent.com/1df39171a43ed1e0874861eefee66d89884f2a3601acd48e0bbf7dbc7e333e6f/68747470733a2f2f6769746875622d70726f6a6563742d696d616765732e73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6c6f676f732f6c61726176656c32737465702d6c6f676f2e706e67)

Laravel 2 Step Verification
===========================

[](#laravel-2-step-verification)

Laravel 2-Step Verification is a package to add 2-Step user authentication to any Laravel project easily. It is configurable and customizable. It uses notifications to send the user an email with a 4-digit verification code. Can be used in out the box with Laravel's authentication scaffolding or integrated into other projects.

[![Travis-CI Build](https://camo.githubusercontent.com/176286e651fc76e70061b7841fc03b70b0bae712b8c5f2b2c1af0ced478b4ada/68747470733a2f2f7472617669732d63692e6f72672f6a6572656d796b656e6564792f6c61726176656c32737465702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jeremykenedy/laravel2step)[![Latest Stable Version](https://camo.githubusercontent.com/3d4d4b2d2ce94f5aca0dde7d2d46fa5170f9919760706441494279c4d455c5ca/68747470733a2f2f706f7365722e707567782e6f72672f6a6572656d796b656e6564792f6c61726176656c32737465702f762f737461626c65)](https://packagist.org/packages/jeremykenedy/laravel2step)[![Total Downloads](https://camo.githubusercontent.com/2c37ab198319dd3f2981823bdaca37395672f4474131fe1fb2f80ff26b468368/68747470733a2f2f706f7365722e707567782e6f72672f6a6572656d796b656e6564792f6c61726176656c32737465702f646f776e6c6f616473)](https://packagist.org/packages/jeremykenedy/laravel2step)[![StyleCI](https://camo.githubusercontent.com/83ad46b991e680f688750d9811594d594ffb2837ff07aadd8f3d73d84926df54/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3131333739393835342f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/113799854)[![Build Status](https://camo.githubusercontent.com/fce96f2f3457126a6cbc1d583f04e013aca723d38eea3730dbf7f98a3adb96a0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a6572656d796b656e6564792f6c61726176656c32737465702f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jeremykenedy/laravel2step/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/31191a9ece7643ea3784da8ad09237abee9b9089dc079e2a14efe4ff93d4f736/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a6572656d796b656e6564792f6c61726176656c32737465702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jeremykenedy/laravel2step/?branch=master)[![Code Intelligence Status](https://camo.githubusercontent.com/3dab8c00faee0b78c46cf204a4c8ef407b179d78716cb7866e59c3cd91d85b48/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a6572656d796b656e6564792f6c61726176656c32737465702f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![MadeWithLaravel.com shield](https://camo.githubusercontent.com/bb3d23b6b6980bffbc25166cb00e5550fe7069d05a0bbd7d9ae8c97b71eb0c0f/68747470733a2f2f6d616465776974686c61726176656c2e636f6d2f73746f726167652f7265706f2d736869656c64732f313337322d736869656c642e737667)](https://madewithlaravel.com/p/laravel-2-step-verification/shield-link)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Table of contents:

- [Features](#features)
- [Requirements](#requirements)
- [Installation Instructions](#installation-instructions)
- [Configuration](#configuration)
    - [Environment File](#environment-file)
- [Usage](#usage)
- [Routes](#routes)
- [Screenshots](#screenshots)
- [File Tree](#file-tree)
- [Future](#future)
- [Opening an Issue](#opening-an-issue)
- [License](#license)

### Features

[](#features)

Laravel 2 Step Verification FeaturesUses [Notification](https://laravel.com/docs/5.5/notifications) Class to send user code to users emailCan publish customizable views and assetsLots of [configuration](#configuration) optionsUses Language [localization](https://laravel.com/docs/5.5/localization) filesVerificaton PageLocked Page### Requirements

[](#requirements)

- [Laravel 5.3, 5.4, 5.5+ ,6+, 7+, 8+, 9+, 10+, 11+, and 12+](https://laravel.com/docs/installation)

### Installation Instructions

[](#installation-instructions)

1. From your projects root folder in terminal run:

    Laravel 6+ use:

    ```
        composer require jeremykenedy/laravel2step
    ```

    Laravel 5.8 use:

    ```
        composer require jeremykenedy/laravel2step:v1.4.0
    ```

    Laravel 5.7 and below use:

    ```
        composer require jeremykenedy/laravel2step:v1.0.2

    ```
2. Register the package

- Laravel 5.5 and up Uses package auto discovery feature, no need to edit the `config/app.php` file.
- Laravel 5.4 and below Register the package with laravel in `config/app.php` under `providers` with the following:

```
    'providers' => [
        jeremykenedy\laravel2step\laravel2stepServiceProvider::class,
    ];
```

3. Publish the packages views, config file, assets, and language files by running the following from your projects root folder:

```
    php artisan vendor:publish --tag=laravel2step
```

4. Optionally Update your `.env` file and associated settings (see [Environment File](#environment-file) section)
5. Run the migration to add the verifications codes table:

```
    php artisan migrate
```

- Note: If you want to specify a different table or connection make sure you update your `.env` file with the needed configuration variables.

6. Make sure your apps email is configured - this is usually done by configuring the Laravel out the box settings in the `.env` file.

### Configuration

[](#configuration)

Laravel 2-Step Verification can be configured in directly in `/config/laravel2step.php` or in the variables in your `.env` file.

##### Environment File

[](#environment-file)

Here are the `.env` file variables available:

```
LARAVEL_2STEP_ENABLED=true
LARAVEL_2STEP_DATABASE_CONNECTION=mysql
LARAVEL_2STEP_DATABASE_TABLE=laravel2step
LARAVEL_2STEP_USER_MODEL=App\User
LARAVEL_2STEP_EMAIL_FROM="anEmailIsrequired@email.com"
LARAVEL_2STEP_EMAIL_FROM_NAME="Laravel 2 Step Verification"
LARAVEL_2STEP_EMAIL_SUBJECT='Laravel 2 Step Verification'
LARAVEL_2STEP_EXCEEDED_COUNT=3
LARAVEL_2STEP_EXCEEDED_COUNTDOWN_MINUTES=1440
LARAVEL_2STEP_VERIFIED_LIFETIME_MINUTES=360
LARAVEL_2STEP_RESET_BUFFER_IN_SECONDS=300
LARAVEL_2STEP_CSS_FILE="css/laravel2step/app.css"
LARAVEL_2STEP_APP_CSS_ENABLED=false
LARAVEL_2STEP_APP_CSS="css/app.css"
LARAVEL_2STEP_BOOTSTRAP_CSS_CDN_ENABLED=true
LARAVEL_2STEP_BOOTSTRAP_CSS_CDN="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
```

### Usage

[](#usage)

Laravel 2-Step Verification is enabled via middleware. You can enable 2-Step Verification in your routes and controllers via the following middleware:

```
twostep
```

Example to start recording page views using middlware in `web.php`:

```
Route::group(['middleware' => ['twostep']], function () {
    Route::get('/home', 'HomeController@index')->name('home');
});
```

### Routes

[](#routes)

- `/verification/needed`
- `/verification/verify`
- `/verification/resend`

### Screenshots

[](#screenshots)

[![Verification Page](https://camo.githubusercontent.com/1c972ef1ca5b7699dca16a59303bb00e3df817357945f20d233a69dd080a90a5/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c32737465702f312d766572696669636174696f6e2d706167652e6a706567)](https://camo.githubusercontent.com/1c972ef1ca5b7699dca16a59303bb00e3df817357945f20d233a69dd080a90a5/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c32737465702f312d766572696669636174696f6e2d706167652e6a706567)[![Resent Email Modal](https://camo.githubusercontent.com/daeb39b7b99061c1a392dca70be6786e741f20180d1ab7a939d23998429aa768/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c32737465702f322d766572696669636174696f6e2d656d61696c2d726573656e742e6a706567)](https://camo.githubusercontent.com/daeb39b7b99061c1a392dca70be6786e741f20180d1ab7a939d23998429aa768/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c32737465702f322d766572696669636174696f6e2d656d61696c2d726573656e742e6a706567)[![Lock Warning Modal](https://camo.githubusercontent.com/4c3541cfc2fa82b694b8af1215656426bf6d939bffbe004b0c8e76abd8f1e9cf/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c32737465702f332d6c6f636b2d7761726e696e672e6a706567)](https://camo.githubusercontent.com/4c3541cfc2fa82b694b8af1215656426bf6d939bffbe004b0c8e76abd8f1e9cf/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c32737465702f332d6c6f636b2d7761726e696e672e6a706567)[![Locked Page](https://camo.githubusercontent.com/b951ede28685a1d24afd8af211ac518203111284e8fdae57a8c009a737ac06ad/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c32737465702f342d6c6f636b2d73637265656e2e6a706567)](https://camo.githubusercontent.com/b951ede28685a1d24afd8af211ac518203111284e8fdae57a8c009a737ac06ad/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c32737465702f342d6c6f636b2d73637265656e2e6a706567)[![Verification Email](https://camo.githubusercontent.com/7fb6ff15898da2ac366bec256247cdcfa3a986049fd08921fff562a57f8a46e6/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c32737465702f352d766572696669636174696f6e2d656d61696c2e6a706567)](https://camo.githubusercontent.com/7fb6ff15898da2ac366bec256247cdcfa3a986049fd08921fff562a57f8a46e6/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f6769746875622d70726f6a6563742d696d616765732f6c61726176656c32737465702f352d766572696669636174696f6e2d656d61696c2e6a706567)

### File Tree

[](#file-tree)

```
└── laravel2step
    ├── .gitignore
    ├── LICENSE
    ├── README.md
    ├── composer.json
    └── src
        ├── .env.example
        ├── Laravel2stepServiceProvider.php
        ├── app
        │   ├── Http
        │   │   ├── Controllers
        │   │   │   └── TwoStepController.php
        │   │   └── Middleware
        │   │       └── Laravel2step.php
        │   ├── Models
        │   │   └── TwoStepAuth.php
        │   ├── Notifications
        │   │   └── SendVerificationCodeEmail.php
        │   └── Traits
        │       └── Laravel2StepTrait.php
        ├── config
        │   └── laravel2step.php
        ├── database
        │   └── migrations
        │       └── 2017_12_09_070937_create_two_step_auth_table.php
        ├── public
        │   └── css
        │       ├── app.css
        │       └── app.min.css
        ├── resources
        │   ├── assets
        │   │   └── scss
        │   │       ├── _animations.scss
        │   │       ├── _mixins.scss
        │   │       ├── _modals.scss
        │   │       ├── _variables.scss
        │   │       ├── _verification.scss
        │   │       └── app.scss
        │   ├── lang
        │   │   └── en
        │   │       └── laravel-verification.php
        │   └── views
        │       ├── layouts
        │       │   └── app.blade.php
        │       ├── partials
        │       ├── scripts
        │       │   └── input-parsing-auto-stepper.blade.php
        │       └── twostep
        │           ├── exceeded.blade.php
        │           └── verification.blade.php
        └── routes
            └── web.php

```

- Tree command can be installed using brew: `brew install tree`
- File tree generated using command `tree -a -I '.git|node_modules|vendor|storage|tests`

### Future

[](#future)

- Unit Tests
- Travis-CI Integration.
- Its own HTML email template.
- Add in additional notifications for SMS or ???.
- Add in capture IP Address.
- Change to incremental tables and logic accordingly
    - Create Artisan command and job to prune said entries.

### Opening an Issue

[](#opening-an-issue)

Before opening an issue there are a couple of considerations:

- You are all awesome!
- **Read the instructions** and make sure all steps were *followed correctly*.
- **Check** that the issue is not *specific to your development environment* setup.
- **Provide** *duplication steps*.
- **Attempt to look into the issue**, and if you *have a solution, make a pull request*.
- **Show that you have made an attempt** to *look into the issue*.
- **Check** to see if the issue you are *reporting is a duplicate* of a previous reported issue.
- **Following these instructions show me that you have tried.**
- If you have a questions send me an email to
- Need some help, I can do my best on Slack:
- Please be considerate that this is an open source project that I provide to the community for FREE when openeing an issue.

Open source projects are a the community’s responsibility to use, contribute, and debug.

### License

[](#license)

Laravel 2-Step Verification is licensed under the MIT license. Enjoy!

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance65

Regular maintenance activity

Popularity51

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 85.9% 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 ~135 days

Recently: every ~438 days

Total

22

Last Release

210d ago

Major Versions

v0.5.0 → v1.0.02018-01-20

v1.9.0 → v2.0.02020-09-21

v2.2.0 → v3.0.02023-02-27

V3.1.0 → V4.0.02025-10-21

PHP version history (7 changes)v0.0.1PHP &gt;=7.0.0

v1.1.0PHP &gt;=7.1.3

v1.5.0PHP ^7.2

v1.9.0PHP ^7.3

v2.1.0PHP ^7.3|^8.0

v3.0.0PHP ^7.3|^8.0|^8.1|^8.2

V4.0.0PHP ^7.3|^8.0|^8.1|^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/05cef7d9ee65723b129042943511207fb34db74a56afbf67b5900987f758c161?d=identicon)[jeremykenedy](/maintainers/jeremykenedy)

---

Top Contributors

[![jeremykenedy](https://avatars.githubusercontent.com/u/6244570?v=4)](https://github.com/jeremykenedy "jeremykenedy (79 commits)")[![maxdestors](https://avatars.githubusercontent.com/u/3854597?v=4)](https://github.com/maxdestors "maxdestors (4 commits)")[![royduin](https://avatars.githubusercontent.com/u/1703233?v=4)](https://github.com/royduin "royduin (4 commits)")[![rdesorme](https://avatars.githubusercontent.com/u/31688687?v=4)](https://github.com/rdesorme "rdesorme (2 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (2 commits)")[![rich1888](https://avatars.githubusercontent.com/u/5458775?v=4)](https://github.com/rich1888 "rich1888 (1 commits)")

---

Tags

2-step2-step-verificationlaravel-verificationverificationlaravelverification2-step verification

### Embed Badge

![Health badge](/badges/jeremykenedy-laravel2step/health.svg)

```
[![Health](https://phpackages.com/badges/jeremykenedy-laravel2step/health.svg)](https://phpackages.com/packages/jeremykenedy-laravel2step)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[rinvex/laravel-authy

Rinvex Authy is a simple wrapper for Authy TOTP, the best rated Two-Factor Authentication service for consumers, simplest 2fa Rest API for developers and a strong authentication platform for the enterprise.

3376.7k1](/packages/rinvex-laravel-authy)

PHPackages © 2026

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