PHP code example of stanfortonski / laravel-twofactor

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

    

stanfortonski / laravel-twofactor example snippets


'providers' => [
    //...
    Stanfortonski\Laraveltwofactor\ServiceProvider::class
],

protected $routeMiddleware = [
    //...
    'twofactor' => \Stanfortonski\Laraveltwofactor\Middleware\TwoFactor::class
];

    Route::get('/home', function(){
        return view('home');
    })->middleware(['auth', 'twofactor']);