emotality / laravel-otp
A Laravel package to send OTP via email & SMS.
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 3
Open Issues: 1
pkg:composer/emotality/laravel-otp
Requires
- php: >=7.2.5
- ext-json: *
- illuminate/http: ^7.0|^8.0|^9.0
This package is auto-updated.
Last update: 2025-10-12 10:23:33 UTC
README
A Laravel package to send OTP via email & SMS. Specify different models and their columns!
Installation
composer require emotality/laravel-otpphp artisan vendor:publish --provider="Emotality\OTP\OTPServiceProvider"- Configure your
config/otp.phpfile
Usage
Import OTP class:
use Emotality\OTP\OTP;
Send OTP to the user that just logged in:
OTP::email($user); OTP::sms($user); OTP::smsOrEmail($user); OTP::smsAndEmail($user);
If OTP was entered correctly, you can remove OTP from database:
OTP::clear($user);
Providers
- Nexmo/Vonage
- PanaceaMobile
- More coming soon!
License
laravel-otp is released under the MIT license. See LICENSE for details.