outl1ne / nova-two-factor
Nova Two Factor Authentication
dev-main
2022-10-26 11:12 UTC
Requires
- php: >=8.0
- bacon/bacon-qr-code: ^2.0
- laravel/nova: ^4.15
- outl1ne/nova-translations-loader: ^5.0
- pragmarx/google2fa-laravel: ^2.0
This package is auto-updated.
Last update: 2024-10-26 15:10:07 UTC
README
Nova-Two-Factor
This Laravel Nova package adds 2FA support to the Nova dashboard.
Requirements
php: >=8.0
laravel/nova: ^4.15
Screenshots
Setup 2FA
Nova login screen with 2FA security
Installation
Install the package in a Laravel Nova project via Composer and run migrations:
# Install nova-two-factor composer require outl1ne/nova-two-factor # Optionally publish the configuration and edit it php artisan vendor:publish --provider="Outl1ne\NovaTwoFactor\TwoFactorServiceProvider" --tag="config" # Run migrations php artisan migrate
Add the Has2FA trait to your configured User model.
<?php namespace App\Models; use Outl1ne\NovaTwoFactor\Has2FA; class User extends Authenticatable { use Has2FA; }
Add the TwoFa middleware to your project's Nova config file (config/nova.php
).
'middleware' => [ // ... \Outl1ne\NovaTwoFactor\Http\Middleware\TwoFa::class ],
Register NovaTwoFactor tool in NovaServiceProvider file.
class NovaServiceProvider extends NovaApplicationServiceProvider{ public function tools() { return [ // ... \Outl1ne\NovaTwoFactor\NovaTwoFactor::make() ]; } }