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

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

aliwebto/otp
============

Laravel OTP Authentication Package

v1.0.1(2y ago)112MITPHPPHP ^7.4|^8.0

Since Jul 17Pushed 2y ago1 watchersCompare

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

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

Laravel OTP Authentication package for iranian
==============================================

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/d386462c61519d64bd994fc9c4d792571d7004c0d9c4beb566d4e21bd445e870/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c69776562746f2f6f74702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aliwebto/otp)[![Total Downloads](https://camo.githubusercontent.com/d8aa1fa5eb8050cf9a84e3658c5cb1ddfcf61c8e0754b555bd9a60fefb831773/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c69776562746f2f6f74702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aliwebto/otp)[![GitHub Actions](https://github.com/aliwebto/otp/actions/workflows/main.yml/badge.svg)](https://github.com/aliwebto/otp/actions/workflows/main.yml/badge.svg)

With this package you can easily handle OTP login/register in laravel .

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

[](#installation)

You can install the package via composer:

```
composer require aliwebto/otp
```

```
php artisan vendor:publish --provider="Aliwebto\Otp\OtpServiceProvider"
```

```
php artisan migrate
```

Usage
-----

[](#usage)

```
use Aliwebto\Otp\Otp;

// generate and send code
Otp::generate("09xxxxxxxxx");

// check entered code
Otp::check("code","09xxxxxxxxx");

// regenerate and send new code
Otp::regenerate("09xxxxxxxxx");

// get regenerate code cooldown in seconds
$code = Otp::lastCode("09xxxxxxxxx");
$seconds = Otp::regenerateCooldown($code);

// check code and login/register

$createUserIfNotExist = true;
$newUserEmail = random_int(100000,9999999)."@aliwento.com";
$newUserName = "User";

$isLoggedIn = Otp::authenticate("CODE","09xxxxxxxxx",$createUserIfNotExist,$newUserEmail,$newUserName);
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Alireza Zarei](https://github.com/aliwebto)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~4 days

Total

2

Last Release

1030d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ded84d8dbce7f0932273039d7541e799616478117b026b436662e2bc5b8833a?d=identicon)[aliwebto](/maintainers/aliwebto)

---

Top Contributors

[![aliwebto](https://avatars.githubusercontent.com/u/70484690?v=4)](https://github.com/aliwebto "aliwebto (18 commits)")

---

Tags

authenticationiraianiranlaravelotpotpaliwebto

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[spomky-labs/otphp

A PHP library for generating one time passwords according to RFC 4226 (HOTP Algorithm) and the RFC 6238 (TOTP Algorithm) and compatible with Google Authenticator

1.5k46.1M119](/packages/spomky-labs-otphp)[fouladgar/laravel-otp

This package provides convenient methods for sending and validating OTP notifications to users for authentication.

21426.5k](/packages/fouladgar-laravel-otp)[teckwei1993/laravel-otp

Laravel OTP generator and validation

5556.0k](/packages/teckwei1993-laravel-otp)

PHPackages © 2026

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