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

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

ghostzero/nova-two-factor
=========================

Nova Two Factor Authentication

02PHP

Since Apr 9Pushed 2y agoCompare

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

READMEChangelogDependenciesVersions (1)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 Stable Version](https://camo.githubusercontent.com/5442e7dd4e1b1f6cd49747ba3e294d965ebe2bf9b42bc45eb4a6c255e9490033/687474703a2f2f706f7365722e707567782e6f72672f766973616e64756d612f6e6f76612d74776f2d666163746f722f76)](https://packagist.org/packages/visanduma/nova-two-factor) [![Total Downloads](https://camo.githubusercontent.com/e289e91e9055d9b5531097f9e5f4ea3ca3a26ea3f9069740c1fad3888da3b0ec/687474703a2f2f706f7365722e707567782e6f72672f766973616e64756d612f6e6f76612d74776f2d666163746f722f646f776e6c6f616473)](https://packagist.org/packages/visanduma/nova-two-factor) [![Latest Unstable Version](https://camo.githubusercontent.com/84d763bbbdd59c75275b4e5b4ae6bcd521cd1639f38ef8615798dbc14c06bcb0/687474703a2f2f706f7365722e707567782e6f72672f766973616e64756d612f6e6f76612d74776f2d666163746f722f762f756e737461626c65)](https://packagist.org/packages/visanduma/nova-two-factor) [![License](https://camo.githubusercontent.com/800a29b0b0c3f671fb3c0e60417f25b6457a072bc4d01711574a618f1d3b9ba9/687474703a2f2f706f7365722e707567782e6f72672f766973616e64756d612f6e6f76612d74776f2d666163746f722f6c6963656e7365)](https://packagist.org/packages/visanduma/nova-two-factor) [![PHP Version Require](https://camo.githubusercontent.com/2b8929afa6470b84ffe5e9679363f78249d85586dda15ef582fde76de4f7cf95/687474703a2f2f706f7365722e707567782e6f72672f766973616e64756d612f6e6f76612d74776f2d666163746f722f726571756972652f706870)](https://packagist.org/packages/visanduma/nova-two-factor)

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

[](#nova-two-factor)

Laravel nova in-dashboard 2FA security feature.

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

[](#whats-new)

### 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 [

     // 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' => [
       // 'nova/resources/users/new',
       // 'nova/resources/users/*/edit',
    ],

    /* timeout in minutes */

    'reauthorize_timeout' => 5,

];

```

2. Use ProtectWith2FA trait in configured model

```
