PHP code example of egately / egate-otp

1. Go to this page and download the library: Download egately/egate-otp 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/ */

    

egately / egate-otp example snippets


return [

    'app_name' => env('APP_NAME'), // this will be used for the title of the authenticator account
    
     'default_identifier_attribute' => 'email', // the default attribute to be used as the identifier to be added to the authenticator account

    'otp_length' => 6, // the length of the generated otp it is 6 by default

    'default_validation_window' => 5,// the minutes before the otp expires

   

];


use Egate\EgateOtp\Traits\HasEgateOtp;



$otp = $user->generateOtp();

// result is true or false, the window is the number of minutes before the otp expires, if not specified the default window will be used
$Vlaidation = $user->ValidateOtp($otp, $window = null); 

bash
php artisan vendor:publish --tag="egate-otp-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="egate-otp-config"