PHPackages                             rawnoq/laravel-otp - 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. rawnoq/laravel-otp

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

rawnoq/laravel-otp
==================

A professional OTP (One-Time Password) package for Laravel

1.5.0(5mo ago)147MITPHPPHP ^8.0

Since Nov 27Pushed 5mo agoCompare

[ Source](https://github.com/rawnoq/laravel-otp)[ Packagist](https://packagist.org/packages/rawnoq/laravel-otp)[ RSS](/packages/rawnoq-laravel-otp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Laravel OTP Package
===================

[](#laravel-otp-package)

A professional, production-ready OTP (One-Time Password) package for Laravel applications.

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

[](#installation)

```
composer require rawnoq/laravel-otp
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=otp-config
```

Usage
-----

[](#usage)

### Generate OTP

[](#generate-otp)

```
use Rawnoq\LaravelOtp\Facades\Otp;

$otp = Otp::generate('user@example.com', 'email');
$code = $otp->otp_code;
```

### Verify OTP

[](#verify-otp)

```
$otp = Otp::verify('user@example.com', '123456', 'email');

if ($otp) {
    // OTP is valid and has been marked as used
}
```

### Check if OTP is Valid

[](#check-if-otp-is-valid)

```
if (Otp::isValid('user@example.com', '123456', 'email')) {
    // OTP is valid
}
```

### Get Latest OTP

[](#get-latest-otp)

```
$otp = Otp::getLatest('user@example.com', 'email');
```

### Count Active OTPs

[](#count-active-otps)

```
$count = Otp::countActive('user@example.com', 'email');
```

### Cleanup Expired OTPs

[](#cleanup-expired-otps)

```
$deleted = Otp::cleanup();
```

### Delete Active OTPs

[](#delete-active-otps)

```
Otp::deleteActive('user@example.com', 'email');
```

Configuration Options
---------------------

[](#configuration-options)

Edit `config/otp.php` to customize:

- Default OTP length
- Default expiry time
- Dev mode settings
- Type-specific configurations (phone, email, etc.)

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance70

Regular maintenance activity

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

167d ago

PHP version history (2 changes)v1.0PHP ^8.1

1.3PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/fef8f5b623783c112ea9b179c610918e020a18fe0e921a48dc45c351cb7b5115?d=identicon)[HassanHassanKerdash](/maintainers/HassanHassanKerdash)

---

Top Contributors

[![HassanHassanKerdash](https://avatars.githubusercontent.com/u/220541638?v=4)](https://github.com/HassanHassanKerdash "HassanHassanKerdash (5 commits)")[![HassanKerdashMoltaqa](https://avatars.githubusercontent.com/u/235504083?v=4)](https://github.com/HassanKerdashMoltaqa "HassanKerdashMoltaqa (2 commits)")

---

Tags

laravelotpAuthenticationverificationone-time-password

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rawnoq-laravel-otp/health.svg)

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

###  Alternatives

[rinvex/laravel-authy

Rinvex Authy is a simple wrapper for Authy TOTP, the best rated Two-Factor Authentication service for consumers, simplest 2fa Rest API for developers and a strong authentication platform for the enterprise.

3376.7k1](/packages/rinvex-laravel-authy)[lakm/nopass

Provides passwordless authentication for your laravel projects.

2213.6k2](/packages/lakm-nopass)[remotemerge/totp-php

Lightweight, fast, and secure TOTP (2FA) authentication library for PHP — battle tested, dependency free, and ready for enterprise integration.

2010.2k](/packages/remotemerge-totp-php)

PHPackages © 2026

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