1. Go to this page and download the library: Download php-monsters/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/ */
php-monsters / laravel-otp example snippets
Otp::generate(string $identifier)
use OTP;
// in your code
$password = Otp::generate('[email protected]');
use OTP;
// in your code
$result = Otp::validate('[email protected]', '123456');
// in a `FormRequest`
use PhpMonsters\Otp\Rules\OtpValidate;
public function rules()
{
return [
'code' => ['
// Otp class
$result = Otp::validate('123456');
// in a `FormRequest`
use PhpMonsters\Otp\Rules\OtpValidate;
public function rules()
{
return [
'code' => ['