PHPackages                             oluomotoso/nova-google2fa - 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. oluomotoso/nova-google2fa

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

oluomotoso/nova-google2fa
=========================

Fork of carloscgo/nova-google2fa to make compatible with Laravel Nova 4

4.0.3(3y ago)08.9k↓85.7%MITPHPPHP ^8.0

Since Oct 16Pushed 3y agoCompare

[ Source](https://github.com/TheByteLabs/nova-google2fa)[ Packagist](https://packagist.org/packages/oluomotoso/nova-google2fa)[ RSS](/packages/oluomotoso-nova-google2fa/feed)WikiDiscussions live Synced 2d ago

READMEChangelogDependencies (3)Versions (22)Used By (0)

Forked from CarlosCGO/nova-google2fa
------------------------------------

[](#forked-from-carloscgonova-google2fa)

This package enforces 2FA for Laravel Nova.

Had to fork this as no other package available that makes it compatible with PHP 7.4

The main issue was

pragmarx/google2fa-laravel: ^0.2.0

This needed updating

Original docs below

Upgrade from 0.0.7 to 1.0.0
---------------------------

[](#upgrade-from-007-to-100)

Upgrade guide is available [Here](docs/upgrade_to_1.0.0.md).

Flow
----

[](#flow)

### Activation

[](#activation)

- User gets recovery codes.

[![Recovery codes](docs/images/recovery-codes.png)](docs/images/recovery-codes.png)

- User activates 2FA on his device.

[![Activate 2FA](docs/images/register.png)](docs/images/register.png)

### Verification

[](#verification)

- User verifies login with 2FA.

[![Enter 2FA](docs/images/enter-code.png)](docs/images/enter-code.png)

### Recovery

[](#recovery)

- If user enters invalid code, recovery button is shown.

[![Enter 2FA](docs/images/invalid-code.png)](docs/images/invalid-code.png)

- User enters recovery code.

[![Enter 2FA](docs/images/enter-recovery-code.png)](docs/images/enter-recovery-code.png)

- User is redirected to activation process.

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

[](#installation)

Install via composer

```
$ composer require carloscgo/nova-google2fa
```

Publish config and migrations

```
$ php artisan vendor:publish --provider="CarlosCGO\Google2fa\ToolServiceProvider"
```

Run migrations

```
$ php artisan migrate
```

Add relation to User model

```
use CarlosCGO\Google2fa\Models\User2fa;

...

/**
 * @return HasOne
 */
public function user2fa(): HasOne
{
    return $this->hasOne(User2fa::class);
}
```

Add middleware to `nova.config`.

```
[
    ...
    'middleware' => [
        ...
        \CarlosCGO\Google2fa\Http\Middleware\Google2fa::class,
        ...
    ],
]
```

Config
------

[](#config)

```
return [
    /**
     * Disable or enable middleware.
     */
    'enabled' => env('GOOGLE_2FA_ENABLED', true),

    'models' => [
        /**
         * Change this variable to path to user model.
         */
        'user' => 'App\User',
    ],
    'tables' => [
        /**
         * Table in which users are stored.
         */
        'user' => 'users',
    ],

    'recovery_codes' => [
        /**
         * Number of recovery codes that will be generated.
         */
        'count'          => 8,

        /**
         * Number of blocks in each recovery code.
         */
        'blocks'         => 3,

        /**
         * Number of characters in each block in recovery code.
         */
        'chars_in_block' => 16,

        /**
         * The following algorithms are currently supported:
         *  - PASSWORD_DEFAULT
         *  - PASSWORD_BCRYPT
         *  - PASSWORD_ARGON2I // available from php 7.2
         */
        'hashing_algorithm' => PASSWORD_BCRYPT,
    ],
];
```

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Jani Cerar](https://github.com/janicerar)

License
-------

[](#license)

MIT license. Please see the [license file](docs/license.md) for more information.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity76

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

Recently: every ~168 days

Total

19

Last Release

1184d ago

Major Versions

v0.0.7 → v1.0.02018-11-09

v1.0.0 → v2.0.02018-11-16

2.0.6 → 4.0.12023-04-06

PHP version history (2 changes)v0.0.1PHP &gt;=7.1.0

4.0.1PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6395682?v=4)[Olumide Omotoso](/maintainers/oluomotoso)[@oluomotoso](https://github.com/oluomotoso)

---

Top Contributors

[![carloscgo](https://avatars.githubusercontent.com/u/693763?v=4)](https://github.com/carloscgo "carloscgo (19 commits)")[![oluomotoso](https://avatars.githubusercontent.com/u/6395682?v=4)](https://github.com/oluomotoso "oluomotoso (16 commits)")[![janicerar](https://avatars.githubusercontent.com/u/29040621?v=4)](https://github.com/janicerar "janicerar (15 commits)")[![hellosg](https://avatars.githubusercontent.com/u/20318538?v=4)](https://github.com/hellosg "hellosg (4 commits)")

---

Tags

laravelgoogle2fagoogle2fanovalaravel 2fa

### Embed Badge

![Health badge](/badges/oluomotoso-nova-google2fa/health.svg)

```
[![Health](https://phpackages.com/badges/oluomotoso-nova-google2fa/health.svg)](https://phpackages.com/packages/oluomotoso-nova-google2fa)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84215.9k9](/packages/stephenjude-filament-two-factor-authentication)[laragear/two-factor

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

341942.8k18](/packages/laragear-two-factor)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[visanduma/nova-two-factor

Nova Two Factor Authentication

58665.0k](/packages/visanduma-nova-two-factor)[lifeonscreen/nova-google2fa

This package provides Google2FA to Laravel Nova.

2488.6k](/packages/lifeonscreen-nova-google2fa)

PHPackages © 2026

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