PHP code example of prasanth-j / otpify

1. Go to this page and download the library: Download prasanth-j/otpify 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/ */

    

prasanth-j / otpify example snippets


return [
    /**
     * The length of token.
     */
    'digits'    => 6,

    /**
     * The expiry time of token in minutes.
     */
    'validity'  => 15
];

php artisan vendor:publish --tag="otpify-migrations"

use PrasanthJ\Otpify\Facades\Otpify;

Otpify::generate(string $identifier, int $userId, string $otpType, int $digits, int $validity);

use PrasanthJ\Otpify\Facades\Otpify;

$otp = Otpify::generate('[email protected]', 2, 'verification', 6, 10);

use PrasanthJ\Otpify\Facades\Otpify;

Otpify::validate(string $identifier, string $token, string $otpType);

use PrasanthJ\Otpify\Facades\Otpify;

$otp = Otpify::generate('[email protected]', '535923', 'verification');

protected function schedule(Schedule $schedule)
{
    $schedule->command('otpify:clean')->daily();
}
bash
php artisan migrate
bash
php artisan vendor:publish --tag="otpify-config"
bash
php artisan otpify:clean