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

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

sp4cecat/nova-google2fa
=======================

Forked from the lifeonscreen package, makes changes to the authenticate blade

v1.02(4y ago)02MITPHPPHP &gt;=7.1.0

Since Oct 16Pushed 4y agoCompare

[ Source](https://github.com/sp4cecat/nova-google2fa)[ Packagist](https://packagist.org/packages/sp4cecat/nova-google2fa)[ RSS](/packages/sp4cecat-nova-google2fa/feed)WikiDiscussions master Synced today

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

LifeOnScreen/nova-google2fa
---------------------------

[](#lifeonscreennova-google2fa)

This package enforces 2FA for Laravel Nova.

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 lifeonscreen/nova-google2fa
```

Publish config and migrations

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

Run migrations

```
$ php artisan migrate
```

Add relation to User model

```
use Lifeonscreen\Google2fa\Models\User2fa;

...

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

Add middleware to `nova.config`.

```
[
    ...
    'middleware' => [
        ...
        \Lifeonscreen\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',

        /**
         * Change this if you need a custom connector
         */
        'user2fa' => User2fa::class,
    ],
    '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

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 82.6% 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 ~109 days

Recently: every ~244 days

Total

10

Last Release

1780d ago

Major Versions

v0.0.7 → v1.0.02018-11-09

### Community

Maintainers

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

---

Top Contributors

[![janicerar](https://avatars.githubusercontent.com/u/29040621?v=4)](https://github.com/janicerar "janicerar (19 commits)")[![sp4cecat](https://avatars.githubusercontent.com/u/2126459?v=4)](https://github.com/sp4cecat "sp4cecat (3 commits)")[![angelocala94](https://avatars.githubusercontent.com/u/6445721?v=4)](https://github.com/angelocala94 "angelocala94 (1 commits)")

---

Tags

laravelnova

### Embed Badge

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

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

###  Alternatives

[visanduma/nova-two-factor

Nova Two Factor Authentication

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

This package provides Google2FA to Laravel Nova.

2488.1k](/packages/lifeonscreen-nova-google2fa)[pktharindu/nova-permissions

Laravel Nova Grouped Permissions (ACL)

136387.1k](/packages/pktharindu-nova-permissions)[sereny/nova-permissions

Laravel Nova - Roles &amp; Permissions

86388.6k1](/packages/sereny-nova-permissions)[jeffbeltran/sanctum-tokens

A Laravel Nova resource tool for sanctum tokens.

54557.4k](/packages/jeffbeltran-sanctum-tokens)[yadahan/nova-bouncer

A Laravel Nova tool for managing Bouncer roles and abilities.

26120.3k](/packages/yadahan-nova-bouncer)

PHPackages © 2026

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