PHPackages                             advancelearn/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. [Framework](/categories/framework)
4. /
5. advancelearn/otp-auth

ActiveLibrary[Framework](/categories/framework)

advancelearn/otp-auth
=====================

otp generate for one field from client and after create otp you can checked is true token

2.1.1(2y ago)88MITPHPPHP ^8.0.2

Since Sep 10Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (7)Used By (0)

\#Advancelearn Otp-auth

[![advancelearn-otp-auth](https://camo.githubusercontent.com/91cb9e897260cb1ecb5acf560fcfd66ff7d152c5105c9eb0f2c26191770b3784/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532304f747025323048616e646c65722e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d616476616e63656c6561726e2532466f74702d61757468267061747465726e3d68657861676f6e73267374796c653d7374796c655f31266465736372697074696f6e3d6f74702b67656e65726174652b666f722b6f6e652b6669656c642b66726f6d2b636c69656e742b616e642b61667465722b6372656174652b6f74702b796f752b63616e2b636865636b65642b69732b747275652b746f6b656e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/91cb9e897260cb1ecb5acf560fcfd66ff7d152c5105c9eb0f2c26191770b3784/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532304f747025323048616e646c65722e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d616476616e63656c6561726e2532466f74702d61757468267061747465726e3d68657861676f6e73267374796c653d7374796c655f31266465736372697074696f6e3d6f74702b67656e65726174652b666f722b6f6e652b6669656c642b66726f6d2b636c69656e742b616e642b61667465722b6372656174652b6f74702b796f752b63616e2b636865636b65642b69732b747275652b746f6b656e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

[![Latest Stable Version](https://camo.githubusercontent.com/6a888f8eee0e73e3a99994a925e7e644b8b3d39c12b76c78ae4f25a56abe4bba/687474703a2f2f706f7365722e707567782e6f72672f616476616e63656c6561726e2f6f74702d617574682f76)](https://packagist.org/packages/advancelearn/otp-auth) [![Total Downloads](https://camo.githubusercontent.com/f60bb4422f7a2ad60a8ea0bdcee1b98cd3dff92451c793677468d3b37f2eb03f/687474703a2f2f706f7365722e707567782e6f72672f616476616e63656c6561726e2f6f74702d617574682f646f776e6c6f616473)](https://packagist.org/packages/advancelearn/otp-auth) [![Latest Unstable Version](https://camo.githubusercontent.com/52338d0938491d71d2c46815fda9acc2829a04282e210571b71ee3b31675e177/687474703a2f2f706f7365722e707567782e6f72672f616476616e63656c6561726e2f6f74702d617574682f762f756e737461626c65)](https://packagist.org/packages/advancelearn/otp-auth) [![License](https://camo.githubusercontent.com/6925c180467a917bc3e449da7ffb8edc4d45e142381b552edd69087caacde9b7/687474703a2f2f706f7365722e707567782e6f72672f616476616e63656c6561726e2f6f74702d617574682f6c6963656e7365)](https://packagist.org/packages/advancelearn/otp-auth) [![PHP Version Require](https://camo.githubusercontent.com/ec33bf74631ce71359821c5028d28b5bee40dbbbfd55993c2c38466d22f18376/687474703a2f2f706f7365722e707567782e6f72672f616476616e63656c6561726e2f6f74702d617574682f726571756972652f706870)](https://packagist.org/packages/advancelearn/otp-auth)

Introduction
------------

[](#introduction)

Welcome to the first package from AdvanceLearn Academy. In this package, we tried to make it easy to create a validation code that is easily available to you, and after receiving the code and token, send it to the user via SMS or email to fill in the form. Validate the user to enter this token and then we will validate the token with the username you send and return the result to you.

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

[](#installation)

You can install the package with Composer.

```
composer require advancelearn/otp-auth
```

Usage
-----

[](#usage)

The `advancelearn/otp-auth`, It is enough to create an object from the main class of the package and in the first step, call the method related to creating the token and send the value of the username to it.

new Object of advancelearn/otp-auth:
------------------------------------

[](#new-object-of-advancelearnotp-auth)

### and call generateToken method::

[](#and-call-generatetoken-method)

```
$package = new OtpHandlerAdvancelearn();
```

add namespace of package to top your php class

```
use Advancelearn\OtpAuth\OtpHandlerAdvancelearn;
```

now call method generateToken and passed data for generate new token and set time for caching otp code

```
$username = request()->input('username');
$token = $package->generateToken(['username' => $username , 'time' => 3]);
```

#### Username can be the user's email or mobile phone

[](#username-can-be-the-users-email-or-mobile-phone)

In this section, you have received the code. Now, according to your project scenario, you can send the validation code to the user, and in the next step, receive the token from the user and send it to the package validation method for accuracy:

```
$token = request()->input('token');
 return $package->verify(['token' => $token , 'username' => $username]);

//example output: If the token is correct than the user's username
{
    "success": "Token is verified you can register or logged in user",
    "status": true
}
```

Conclusion
----------

[](#conclusion)

With this advanced learning package called advancelearn/otp-auth, you can easily send the user's username and receive the token, and you will not have the trouble of creating or saving the token in the database, because the token for the user's username is easily cached according to the time you give. and in the second step, the token validation is applied to the requested username, and according to that, you can successfully register the user in the system or direct the user to the resend code page.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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 ~0 days

Total

6

Last Release

978d ago

Major Versions

1.1.1 → 2.0.02023-09-10

### Community

Maintainers

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

---

Top Contributors

[![Saberqadimi](https://avatars.githubusercontent.com/u/83162836?v=4)](https://github.com/Saberqadimi "Saberqadimi (6 commits)")

---

Tags

frameworklaravelauthlaravel-packageLaravel Authadvancelearnotp-auth

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[krayin/laravel-crm

Krayin CRM

22.0k32.8k1](/packages/krayin-laravel-crm)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[milwad/laravel-validate

The Laravel-Validate package enhanced Laravel validation capabilities with custom rules and methods for simplified and efficient validation logic.

59739.5k1](/packages/milwad-laravel-validate)[binafy/laravel-user-monitoring

Monitor your user and all activity on your application

57425.7k](/packages/binafy-laravel-user-monitoring)[binafy/laravel-cart

Laravel Cart is a customizable package for adding shopping cart functionality to Laravel applications

40445.9k](/packages/binafy-laravel-cart)

PHPackages © 2026

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