Download the PHP package itsmurumba/laravel-otp without Composer
On this page you can find all versions of the php package itsmurumba/laravel-otp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download itsmurumba/laravel-otp
More information about itsmurumba/laravel-otp
Files in itsmurumba/laravel-otp
Package laravel-otp
Short Description Laravel Package for sending otps via SMS, Email, Slack
License MIT
Informations about the package laravel-otp
Laravel OTP
A flexible and feature-rich Laravel package for generating and sending One-Time Passwords (OTP) through multiple channels including Email, SMS, WhatsApp, Telegram, and Slack.
Features
- 📱 Multiple delivery channels (Email, SMS, WhatsApp, Telegram, Slack)
- 🔢 Configurable OTP formats (numeric, alphanumeric)
- ⏱️ Customizable expiration time
- 🔄 Easy channel switching
- ✅ Channel-specific validation
- 🛠️ Extensible architecture
Requirements
- PHP 8.1 or higher
- Laravel 10, 11, 12, or 13 (CI is tested against 12 and 13)
Installation
You can install the package via composer:
After installation, publish the configuration file:
Configuration
Copy the required environment variables from .env.example to your .env file and configure them according to your needs:
The package supports the following channels, each requiring specific configurations:
- Requires Laravel mail settings
- Uses standard Laravel mail configuration
SMS
- Requires SMS API credentials
- Configure
SMS_API_KEYandSMS_API_URL
- Requires WhatsApp Business API credentials
- Configure
WHATSAPP_API_KEYandWHATSAPP_API_URL
Telegram
- Requires Telegram Bot Token
- Configure
TELEGRAM_BOT_TOKEN
Slack
- Requires Slack Webhook URL
- Configure
SLACK_WEBHOOK_URL
Usage
Basic Usage
You can also resolve the underlying service directly instead of the facade (via the otp() helper or the otp container binding):
Channel-Specific Usage
SMS
Telegram
Slack
Sending via Multiple Channels
Pass an array of channel names to send the same OTP through more than one channel:
OTP Verification
verify() checks the code against the stored, non-expired, unverified OTP for that identifier and marks it as verified on success.
Testing
To run the test suite with code coverage (requires Xdebug or PCOV):
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-otp with dependencies
illuminate/support Version ^12.0|^13.0
guzzlehttp/guzzle Version ^6.0|^7.0