PHPackages                             visanduma/nova-two-factor - 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. visanduma/nova-two-factor

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

visanduma/nova-two-factor
=========================

Nova Two Factor Authentication

3.0.1(1y ago)56621.3k↓12.2%35[4 issues](https://github.com/Visanduma/nova-two-factor/issues)[1 PRs](https://github.com/Visanduma/nova-two-factor/pulls)MITPHPPHP ^8.1

Since Apr 27Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Visanduma/nova-two-factor)[ Packagist](https://packagist.org/packages/visanduma/nova-two-factor)[ RSS](/packages/visanduma-nova-two-factor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (32)Used By (0)

[![](https://github.com/Visanduma/nova-two-factor/raw/c26d41cb38c5850e7ee3863e34e5fd3b0c3f18a5/resources/img/nova-two-factor-banner.png?raw=true)](https://github.com/Visanduma/nova-two-factor/blob/c26d41cb38c5850e7ee3863e34e5fd3b0c3f18a5/resources/img/nova-two-factor-banner.png?raw=true)

[![Latest Version on Packagist](https://camo.githubusercontent.com/81863c4b6aeffd279c6bd6ce84cf3d05a7a386651f225ad64d9101667f8c8758/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766973616e64756d612f6e6f76612d74776f2d666163746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/visanduma/nova-two-factor)[![Total Downloads](https://camo.githubusercontent.com/00a4ae2f269582811a6b93972e4eb1c8f15f18f97d94872043a963baddfc69fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766973616e64756d612f6e6f76612d74776f2d666163746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/visanduma/nova-two-factor)

Nova-Two-Factor
===============

[](#nova-two-factor)

Laravel nova in-dashboard 2FA security feature.

Versions
--------

[](#versions)

Use v3.\* for Laravel Nova 5

Use v2.\* for Laravel Nova 4

Use ^v1.\* for Laravel Nova 3

```
\\ Nova 5

composer require visanduma/nova-two-factor:~3

\\ Nova 4

composer require visanduma/nova-two-factor:~2

\\ Nova 3

composer require visanduma/nova-two-factor:~1

```

What's New
----------

[](#whats-new)

### v3.0

[](#v30)

- Nova 5.0 support

### v2.2.14

[](#v2214)

- Fixed offline QRCode display issue

### v2.2.3

[](#v223)

- Fixed foreign key issue (need to run migration)
- Translation fixes

### v2.2.2

[](#v222)

- Clear option for current Two FA settings

### v2.2.0

[](#v220)

- Reauthorize any routes using *2FA Prompt* dialog.

Interface
---------

[](#interface)

Setup 2FA

[![screenshot](/resources/img/sc-1.png)](/resources/img/sc-1.png)

Enable/Disable feature

[![screenshot](/resources/img/sc-2.png)](/resources/img/sc-2.png)

Nova login screen with 2FA security

[![screenshot](/resources/img/sc-3.png)](/resources/img/sc-3.png)

Reauthorize any route using 2FA prompt

[![screenshot](/resources/img/sc-4.png)](/resources/img/sc-4.png)

Install the package

`composer require visanduma/nova-two-factor`

1. Pubish config &amp; migration

`php artisan vendor:publish --provider="Visanduma\NovaTwoFactor\ToolServiceProvider"`

Change configs as your needs

```

return [
    // defaults to app.name when null
    'display_name' => null,

     // enable or disable 2FA feature. default is enabled
    'enabled' => env('NOVA_TWO_FA_ENABLE',true),

    // name of authenticatable entity table. usually - users
    'user_table' => 'users',

    // Entity primary key
    'user_id_column' => 'id',

    // authenticatable model class
    'user_model' => \App\Models\User::class

    /* Change visibility of Nova Two Fa menu in right sidebar */
    'showin_sidebar' => true,

    'menu_text' => 'Two FA',

    'menu_icon' => 'lock-closed',

    /* Exclude any routes from 2fa security */
    'except_routes' => [
        //
    ],

    /**
     * reauthorize these urls before access, withing given timeout
     * you are allowed to use wildcards pattern for url matching
     **/

    'reauthorize_urls' => [
       // 'resources/users/new',
       // 'resources/users/*/edit',
    ],

    /* timeout in minutes */

    'reauthorize_timeout' => 5,

    /* QR code can be generate using  online API or inbuilt 'BaconQrCode' package*/

    'use_offline_qr' => false,

];

```

2. Use ProtectWith2FA trait in configured model

```
