laravel-otp maintained by alrez96
Description
OTP login system for the Laravel framework.
Author
Last update
2024/05/10 18:51
(dev-develop)
License
Downloads
9
Tags
Laravel OTP - One-Time Password Authentication
Introduction
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.
Installation
You can install the package via composer:
composer require alrez96/laravel-otp
Configuration
You should publish the migration and the config/otp.php config file with:
php artisan vendor:publish --provider="Alrez96\LaravelOtp\OtpServiceProvider"
Usage
Generate OTP Token
<?php
use Alrez96\LaravelOtp\Facades\Otp;
Otp::generateToken(string $identifier);
// or using helper
otp()->generateToken(string $identifier);
Validate OTP Token
<?php
use Alrez96\LaravelOtp\Facades\Otp;
Otp::validateToken(string $identifier, string $token);
// or using helper
otp()->validateToken(string $identifier, string $token);
License
This package is open-sourced software licensed under the MIT license.