PHP code example of alish / laravel-otp

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

    

alish / laravel-otp example snippets


$token = Otp::issue($key = "string");

$bool = Otp::revoke($key = 'string'); // return true if a valid provided key revoked

$bool = Otp::check($key = 'string', $token = 'already issued token'); // if key and token match return true

$bool = Otp::use($key = 'string', $token = 'already issued token'); // return true if provided key, token match
bash
php artisan vendor:publish --provider="Alish\LaravelOtp\OtpServiceProvider" --tag=migrations
bash
php artisan migrate
bash
php artisan vendor:publish --provider="Alish\LaravelOtp\OtpServiceProvider" --tag=config