analogrepublic / nova-duo
Nova Duo
v0.0.4-alpha
2024-10-14 11:33 UTC
Requires
- php: ^8.0
- duosecurity/duo_universal_php: ^1.0
- laravel/nova: ^4.0
This package is auto-updated.
Last update: 2025-02-22 09:28:19 UTC
README
Nova Duo
Laravel Nova Duo multi factor authentication.
Install the package
composer require analogrepublic/nova-duo
- Publish config
php artisan vendor:publish --provider="AnalogRepublic\NovaDuo\ToolServiceProvider"
Change configs as your needs
return [
'enabled' => env('NOVA_DUO_ENABLED', true),
'duo' => [
'client_id' => env('NOVA_DUO_CLIENT_ID'),
'client_secret' => env('NOVA_DUO_CLIENT_SECRET'),
'api_hostname' => env('NOVA_DUO_API_HOSTNAME'),
]
];
- Add Nova Duo middleware to Nova config file
/*
|--------------------------------------------------------------------------
| Nova Route Middleware
|--------------------------------------------------------------------------
|
| These middleware will be assigned to every Nova route, giving you the
| chance to add your own middleware to this stack or override any of
| the existing middleware. Or, you can just stick with this stack.
|
*/
'middleware' => [
...
\AnalogRepublic\NovaDuo\Http\Middleware\TwoFa::class
],
- Register Nova Duo tool in Nova Service Provider
<?php
class NovaServiceProvider extends NovaApplicationServiceProvider{
public function tools()
{
return [
...
new \AnalogRepublic\NovaDuo\NovaDuo()
];
}
}
- You are done !