1. Go to this page and download the library: Download putheakhem/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/ */
putheakhem / laravel-otp example snippets
return [
'length' => 6, // OTP length
'expires_in' => 300, // OTP expiration time in seconds (5 minutes)
'max_attempts' => 5, // Maximum failed attempts before invalidation
'lock_to_session' => true, // OTP tied to user session
'mail_template' => 'otp::emails.otp', // Email template for OTP
'logging_enabled' => true, // Enable OTP logging
];
use PutheaKhem\Otp\Facades\Otp;
$otp = Otp::generate('[email protected]');
dd($otp);