PHP code example of cloudmazing / filament-force-2fa

1. Go to this page and download the library: Download cloudmazing/filament-force-2fa library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cloudmazing / filament-force-2fa example snippets


    /*
    |--------------------------------------------------------------------------
    | Middleware
    |--------------------------------------------------------------------------
    |
    | You may customise the middleware stack that Filament uses to handle
    | requests.
    |
    */

    'middleware' => [
        'auth' => [
            // ...
            \CloudMazing\FilamentForce2FA\Http\Middleware\Require2FA::class,
        ],
        'base' => [
            //...
        ],
    ],

    protected $routeMiddleware = [
        //...
        '2fa' => \CloudMazing\FilamentForce2FA\Http\Middleware\Require2FA::class,
    ];

Route::middleware('2fa')->get('/hello');
bash
php artisan vendor:publish --tag="filament-force-2fa-migrations"
php artisan migrate