A simple OTP package for laravel 9.
composer require hellojie/laravel-otp:dev-main
php artisan vendor:publish
<?php
use Hellojie\LaravelOtp\OtpService;
/** @var OtpService $otpService */
$otpService = app(OtpService::class);
$token = $otpService->generate('test-key');
<?php
use Hellojie\LaravelOtp\OtpService;
/** @var OtpService $otpService */
$otpService = app(OtpService::class);
$isValid = $otpService->validate('test-key', 'test-token');