This package enforces 2FA for Laravel Nova.
Upgrade guide is available Here.
- User gets recovery codes.
- User activates 2FA on his device.
- User verifies login with 2FA.
- If user enters invalid code, recovery button is shown.
- User enters recovery code.
- User is redirected to activation process.
Install via composer
$ composer require carloscgo/nova-google2faPublish config and migrations
$ php artisan vendor:publish --provider="CarlosCGO\Google2fa\ToolServiceProvider"Run migrations
$ php artisan migrateAdd 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,
...
],
]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.




