This is a simple package for implementing the OTP system in Laravel, which only includes generating the token and validating it. You can use this package alongside Laravel's authentication system or the laravel/breeze package.
You can install the package via composer:
composer require alrez96/laravel-otp
You should publish the migration and the config/otp.php config file with:
php artisan vendor:publish --provider="Alrez96\LaravelOtp\OtpServiceProvider"
<?php
use Alrez96\LaravelOtp\Facades\Otp;
Otp::generateToken(string $identifier);
// or using helper
otp()->generateToken(string $identifier);
<?php
use Alrez96\LaravelOtp\Facades\Otp;
Otp::validateToken(string $identifier, string $token);
// or using helper
otp()->validateToken(string $identifier, string $token);
This package is open-sourced software licensed under the MIT license.