analogrepublic/nova-duo

v0.0.4-alpha 2024-10-14 11:33 UTC

This package is auto-updated.

Last update: 2025-02-22 09:28:19 UTC


README

Latest Version on Packagist Total Downloads

Nova Duo

Laravel Nova Duo multi factor authentication.

Install the package

composer require analogrepublic/nova-duo

  1. 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'),
    ]

];


  1. 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
    ],

  1. Register Nova Duo tool in Nova Service Provider
<?php

class NovaServiceProvider extends NovaApplicationServiceProvider{

public function tools()
    {
        return [
            ...
            new \AnalogRepublic\NovaDuo\NovaDuo()

        ];
    }

}


  1. You are done !