PHPackages                             raisulhridoy/laravel-2fa - 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. raisulhridoy/laravel-2fa

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

raisulhridoy/laravel-2fa
========================

Laravel 2FA is a PHP implementation of the Google Two-Factor Authentication Module, supporting the HMAC-Based One-time Password (HOTP) algorithm specified in RFC 4226 and the Time-based One-time Password (TOTP) algorithm specified in RFC 6238.

v0.0.1(2y ago)07MITPHP

Since Jun 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/hridoyraisul/Laravel-2FA-Package)[ Packagist](https://packagist.org/packages/raisulhridoy/laravel-2fa)[ RSS](/packages/raisulhridoy-laravel-2fa/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Laravel 2FA
===========

[](#laravel-2fa)

This package provides a simple and intuitive way of adding two-factor authentication to your Laravel application. It's perfect for developers who want a lightweight package that gets the job done without any unnecessary complexity.

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

[](#installation)

Use the package manager [composer](https://getcomposer.org/installer) to install this package.

```
composer require raisulhridoy/laravel-2fa
```

Add the service provider in config/app.php file in the providers array as below:

```
RaisulHridoy\Laravel2FA\TwoFactorAuthServiceProvider::class,
```

Publish the package configuration

```
php artisan vendor:publish --provider="RaisulHridoy\Laravel2FA\TwoFactorAuthServiceProvider"
```

Specify table name corresponding to the 2FA functionality in ".env" file. By default, it will be 'users' respectively and "google2fa\_secret", "google2fa\_enabled" &amp; "google2fa\_verify\_status" column will be added in this table.

```
TFA_WITH_TABLE=
```

For example, if you want to use "users" table for the 2FA functionality, then you have to specify like this in ".env" file.

```
TFA_WITH_TABLE=users
```

Run these commands to clear the cache and migrate the database.

```
php artisan config:clear
php artisan cache:clear
php artisan migrate
```

Basic Usage
===========

[](#basic-usage)

```
# Initialize the namespace
use RaisulHridoy\Laravel2FA\Http\App\TFA;
```

Full instruction coming soon ...............

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1059d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e30b09b924d801c67e8a4439a34865ff1de09391e22641c71ed92c71ccd19f39?d=identicon)[hridoyraisul](/maintainers/hridoyraisul)

---

Top Contributors

[![hridoyraisul](https://avatars.githubusercontent.com/u/46390389?v=4)](https://github.com/hridoyraisul "hridoyraisul (4 commits)")

---

Tags

laravel2faTwo Factor Authenticationlaravel 2falaravel-two-factor-authentication

### Embed Badge

![Health badge](/badges/raisulhridoy-laravel-2fa/health.svg)

```
[![Health](https://phpackages.com/badges/raisulhridoy-laravel-2fa/health.svg)](https://phpackages.com/packages/raisulhridoy-laravel-2fa)
```

###  Alternatives

[laragear/two-factor

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

339785.3k8](/packages/laragear-two-factor)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

81158.7k4](/packages/stephenjude-filament-two-factor-authentication)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[awes-io/auth

Laravel Authentication package with built-in two-factor (Authy) and social authentication (Socialite).

3826.7k1](/packages/awes-io-auth)[webbingbrasil/filament-2fa

A 2FA plugin for filament.

4740.7k](/packages/webbingbrasil-filament-2fa)

PHPackages © 2026

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