hellojie / laravel-otp
A simple OTP package
dev-main
2022-11-27 09:43 UTC
Requires
- php: ^8.1
- illuminate/database: ^9.41
- illuminate/support: ^9.41
- nesbot/carbon: ^2.63
Requires (Dev)
- orchestra/testbench: ^7.14
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-04-27 12:54:26 UTC
README
Introduction
A simple OTP package for laravel 9.
Installation
composer require hellojie/laravel-otp:dev-main
Publish the migrations
php artisan vendor:publish
Usage
Generate OTP
<?php use Hellojie\LaravelOtp\OtpService; /** @var OtpService $otpService */ $otpService = app(OtpService::class); $token = $otpService->generate('test-key');
Validate OTP
<?php use Hellojie\LaravelOtp\OtpService; /** @var OtpService $otpService */ $otpService = app(OtpService::class); $isValid = $otpService->validate('test-key', 'test-token');