This package provides Google2FA to Laravel Nova.
carloscgo/nova-google2fa is a Laravel package for this package provides google2fa to laravel nova..
It currently has 2 GitHub stars and 5.552 downloads on Packagist (latest version v2.0.4).
Install it with composer require carloscgo/nova-google2fa.
Discover more Laravel packages by carloscgo
or browse all Laravel packages to compare alternatives.
Last updated
This package enforces 2FA for Laravel Nova.
Upgrade guide is available Here.





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,
...
],
]
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,
],
];
If you discover any security-related issues, please email the author instead of using the issue tracker.
MIT license. Please see the license file for more information.