PHP code example of top20ofe / two-factor-authentication

1. Go to this page and download the library: Download top20ofe/two-factor-authentication 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/ */

    

top20ofe / two-factor-authentication example snippets


[
 'providers' => [
    //...
    Top20ofe\TwoFactorAuthentication\TwoFactorAuthenticationServiceProvider::class
  ]
]

use AuthenticatesUsers, AuthenticatesUsersWith2FA {
    AuthenticatesUsersWith2FA::authenticated insteadof AuthenticatesUsers;
}
bash
$ php artisan migrate

$ php artisan vendor:publish --provider="Top20ofe\TwoFactorAuthentication\TwoFactorAuthenticationServiceProvider"