1. Go to this page and download the library: Download digitaltunnel/otakit 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/ */
digitaltunnel / otakit example snippets
use DigitalTunnel\OtaKit\Traits\Otakit;
class User extends Model
{
use Otakit;
}
use App\Models\User;
$user = User::find(1);
$otp = $user->generateOtp();
$otp = $user->generateOtp(length: 6, ttl: 10);
use App\Models\Customer;
use DigitalTunnel\Otakit\Actions\GenerateOtp;
$otpable = Customer::find(1);
$otp = (new GenerateOtp)->handle(
otpable :$otpable,
length :4,
ttl: 5 // Time to live in minutes
)