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

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

itsmeabde/easy-otp
==================

Easy OTP (Onetime Password) for Laravel 7|8

v1.0.0(4y ago)06MITPHPPHP ^7.2.5|^8

Since Oct 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/itsmeabde/easy-otp)[ Packagist](https://packagist.org/packages/itsmeabde/easy-otp)[ Docs](https://github.com/itsmeabde/easy-otp)[ RSS](/packages/itsmeabde-easy-otp/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Laravel Easy OTP (Onetime Password)
===================================

[](#laravel-easy-otp-onetime-password)

Easy OTP is laravel package for create simple onetime password system

[![Latest Version on Packagist](https://camo.githubusercontent.com/61bad08aaffafc98d32ddbb4f7ab0bba06de68f59b606e08cb8ed53a8f623f06/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6974736d65616264652f656173792d6f74702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/itsmeabde/easy-otp)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/73df4686f5cec84f9dd0db4a5c647d9ba4f8674b2d3806e0c963d69935d041e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6974736d65616264652f656173792d6f74702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/itsmeabde/easy-otp)

Support Laravel Version 7|8
---------------------------

[](#support-laravel-version-78)

Install
-------

[](#install)

Via composer

```
$ composer require itsmeabde/easy-otp
```

Finally, you will want to publish the config using the following command:

```
$ php artisan vendor:publish --tag=otp
$ php artisan migrate
```

Usage
-----

[](#usage)

```
use App\Http\Controllers\Controller;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;
use Itsmeabde\EasyOtp\Exceptions\OtpException;
use Itsmeabde\EasyOtp\Otp;

class OtpController extends Controller
{
    public $otp;

    public function __construct(Otp $otp)
    {
        $this->otp = $otp;
    }

    public function create(Request $request): JsonResponse
    {
        $request->validate([
            'name' => 'required|string|min:3|max:100',
            'email' => 'required|email'
        ]);

        $identifier = sha1($request->input('email'));

        [$identifier, $pin, $expiresIn] = $this->otp->generate(
            $identifier,
            function ($identifier, $pin, $expiresIn) {
                // Send notification to users
            });

        return response()->json(
            compact('identifier', 'expiresIn')
        );
    }

    public function verify(Request $request): JsonResponse
    {
        $request->validate([
            'identifier' => 'required|string',
            'pin' => 'required|numeric'
        ]);

        try {
            $this->otp->validate(
                $request->input('identifier'),
                $request->input('pin'),
                function ($identifier) {
                    // Send notification to users
                });
        } catch (OtpException $e) {
            throw ValidationException::withMessages(
                $e->getMessageBag()
            );
        }

        return response()->json([
            'message' => 'Successfully verified.'
        ]);
    }

    public function resend(Request $request): JsonResponse
    {
        $request->validate(['identifier' => 'required|string']);

        try {
            [$identifier, $pin, $expiresIn] = $this->otp->generate(
                $request->input('identifier'),
                function ($identifier, $pin, $expiresIn) {
                    // Resend notification to users
                }, $requestExtraTime = true);
        } catch (OtpException $e) {
            throw ValidationException::withMessages(
                $e->getMessageBag()
            );
        }

        return response()->json([
            'message' => 'Successfully resend.',
        ]);
    }
}
```

License
-------

[](#license)

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

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

1664d ago

### Community

Maintainers

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

---

Top Contributors

[![itsmeabde](https://avatars.githubusercontent.com/u/21280766?v=4)](https://github.com/itsmeabde "itsmeabde (1 commits)")

---

Tags

laravelotp

### Embed Badge

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

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

###  Alternatives

[lakm/nopass

Provides passwordless authentication for your laravel projects.

2213.6k2](/packages/lakm-nopass)

PHPackages © 2026

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