PHPackages                             rezak/otp-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. rezak/otp-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

rezak/otp-auth
==============

A Laravel package for OTP endpoint implementation

01[1 issues](https://github.com/rezak9876/otp-auth/issues)PHP

Since Nov 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rezak9876/otp-auth)[ Packagist](https://packagist.org/packages/rezak/otp-auth)[ RSS](/packages/rezak-otp-auth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

OTP Authentication Package for Laravel
======================================

[](#otp-authentication-package-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/856ca73be1e43f842b9338f140d41cd66cf6fa85439893fe718e89332f8c50dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72657a616b2f6f74702d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rezak/otp-auth)[![Total Downloads](https://camo.githubusercontent.com/1ea86305fa547dcb2a440127867a6905cb1fc8d772ba6d9e1da2f247f10a02b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72657a616b2f6f74702d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rezak/otp-auth)

This package provides an OTP-based authentication system for Laravel applications, including SMS-based OTP generation and verification.

Features
--------

[](#features)

- Generate OTPs and send via SMS
- Verify OTPs for authentication
- Easy to integrate into any Laravel application

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require rezak/otp-auth
```

Configuration
-------------

[](#configuration)

1. Publish the configuration and language files:

```
php artisan vendor:publish --provider="RezaK\OtpAuth\Providers\OtpAuthServiceProvider"
```

2. Add your SMS gateway service to the `SMSSenderInterface` implementation.

Usage
-----

[](#usage)

### Routes

[](#routes)

The package automatically registers the following routes:

- **POST** `/api/auth/otp/send` - Send OTP to a mobile number.
- **POST** `/api/auth/otp/verify` - Verify OTP for a mobile number.

### Example Request

[](#example-request)

#### Sending OTP

[](#sending-otp)

```
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"mobile_number": "09123456789"}' \
  http://your-app-url/api/auth/otp/send
```

#### Verifying OTP

[](#verifying-otp)

```
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"mobile_number": "09123456789", "otp": "123456"}' \
  http://your-app-url/api/auth/otp/verify
```

Testing
-------

[](#testing)

Run the tests with:

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/756868a7289369c638fc953b5aaea56dbcb85f9b4eda5bc598050c0592246d66?d=identicon)[rezak](/maintainers/rezak)

---

Top Contributors

[![rezak9876](https://avatars.githubusercontent.com/u/121686688?v=4)](https://github.com/rezak9876 "rezak9876 (2 commits)")

### Embed Badge

![Health badge](/badges/rezak-otp-auth/health.svg)

```
[![Health](https://phpackages.com/badges/rezak-otp-auth/health.svg)](https://phpackages.com/packages/rezak-otp-auth)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
