PHP code example of sicaboy / laravel-mfa

1. Go to this page and download the library: Download sicaboy/laravel-mfa 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/ */

    

sicaboy / laravel-mfa example snippets


Siaboy\LaravelMFA\LaravelMFAServiceProvider::class,

Route::middleware(['mfa'])->group(function () {
    ...
});

Route::middleware(['mfa:admin'])->group(function () {
    ...
});

return [
    'default' => [
        ...
    ],
    'group' 
        'admin' => [ // Example, when using middleware 'mfa:admin'. Attributes not mentioned will be inherit from `default` above
            'login_route' => 'admin.login',
            'auth_user_closure' => function() {
                return \Encore\Admin\Facades\Admin::user();
            },
        ],
        'other_name' => [ // Middleware 'mfa:other_name'
            ...
        ]
    ],

return [
    'default' => [
        ...
        'email' => [
            'queue' => true,
        ...
        ]
    ]
]

php artisan vendor:publish --provider="Sicaboy\LaravelMFA\LaravelMFAServiceProvider"

app/config/laravel-mfa.php
resources/views/vendor/laravel-mfa/