bbim/otpify

Laravel OTP verification library with multiple drivers

dev-main 2025-09-07 10:09 UTC

This package is not auto-updated.

Last update: 2025-09-08 08:33:14 UTC


README

A comprehensive Laravel package for OTP (One-Time Password) verification with multiple drivers support including SMS, Email, and external services.

Features

  • ๐Ÿš€ Multiple drivers support (SMS, Email, Absher, Authorization)
  • ๐Ÿ”’ Secure OTP generation and validation
  • โฐ Configurable expiration times
  • ๐Ÿ“ฑ Easy integration with existing Laravel projects
  • ๐Ÿงช Fake drivers for testing
  • ๐ŸŒ Multi-language support

Installation

composer require bbim/otpify

Configuration

Publish the configuration file:

php artisan vendor:publish --provider="Bbim\Otpify\Providers\OtpifyServiceProvider"

Usage

Basic Usage

use Bbim\Otpify\Facades\Otpify;

// Generate OTP
$otp = Otpify::generate('user@example.com');

// Verify OTP
$isValid = Otpify::verify('user@example.com', '123456');

Available Drivers

  • Email Driver: Send OTP via email
  • SMS Driver: Send OTP via SMS (Twilio integration)
  • Absher Driver: Integration with Absher service
  • Authorization Driver: Custom authorization flow
  • Fake Driver: For testing purposes

Requirements

  • PHP >= 8.2
  • Laravel >= 10.0

License

MIT License