PHPackages                             moeen-basra/laravel-passport-otp-grant - 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. moeen-basra/laravel-passport-otp-grant

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

moeen-basra/laravel-passport-otp-grant
======================================

Laravel Passport One Time Pin Grant

v1.1.0(4y ago)01.3kMITPHPPHP ^8.1

Since Jan 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/moeen-basra/laravel-passport-otp-grant)[ Packagist](https://packagist.org/packages/moeen-basra/laravel-passport-otp-grant)[ RSS](/packages/moeen-basra-laravel-passport-otp-grant/feed)WikiDiscussions main Synced 2d ago

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

Laravel Passport OTP Grant
==========================

[](#laravel-passport-otp-grant)

This is a small package for laravel passport otp authentication easy to integrate.

How to
------

[](#how-to)

Following are a few steps you need to follow to make it work.

1. Install this package using the composer

```
composer require moeen-basra/laravel-passport-otp-grant
```

2. Implement the `MoeenBasra\OneTimePinGrant\Interfaces\OneTimePinGrantUserInterface` on your desired provider model.

```
use Illuminate\Foundation\Auth\User as BaseUser;
use MoeenBasra\OneTimePinGrant\Interfaces\OneTimePinGrantUserInterface;

class User extends BaseUser implements OneTimePinGrantUserInterface
{
    //...

    /**
     * {@inheritDoc}
     */
    public function findAndValidateForPassportOtpGrant(string $mobile_number, string $code)
    {
        if (!OneTimePin::validate($mobile_number, $code)) {
            return null;
        }

        return static::firstOrCreate([
            'mobile_number' => $mobile_number
        ]);
    }
}
```

3. This step is optional, add the service provider under the providers array in `config/app.php`.

```
   'providers' => [
        //...
        MoeenBasra\OneTimePinGrant\OneTimePinGrantServiceProvider::class,
    ]
```

That's it now you can call the otp login using same params you use for other passport end points

```
curl --location --request POST 'https://api.example.com/oauth/token' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--form 'username="mobile_number"' \
--form 'password="code"' \
--form 'grant_type="otp"' \
--form 'client_id="client_id"' \
--form 'client_secret="client_secret"' \
--form 'scope="*"'
```

More
----

[](#more)

You can check out the [Laravel Passport](https://laravel.com/docs/master/passport) official documentation for more details.

Contributions
-------------

[](#contributions)

You are welcome, you can create a [pull request](https://github.com/qiutuleng/vue-router-modern/pulls). You will be credited for any contribution.

Issues
------

[](#issues)

If you are facing any problem feel free to report [here](https://github.com/qiutuleng/vue-router-modern/issues).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

1578d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29e85434bbb62af31bbfe18c0983fd39f14e472995e53ecfab734258fd470b9b?d=identicon)[moeen-basra](/maintainers/moeen-basra)

---

Top Contributors

[![moeen-basra](https://avatars.githubusercontent.com/u/3841052?v=4)](https://github.com/moeen-basra "moeen-basra (6 commits)")

---

Tags

laravelotppassportone-time-passwordone time pinPassport OTP Grant

### Embed Badge

![Health badge](/badges/moeen-basra-laravel-passport-otp-grant/health.svg)

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

###  Alternatives

[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)[danjdewhurst/laravel-passport-facebook-login

Facebook Token Request Grant for Laravel Passport

2824.4k](/packages/danjdewhurst-laravel-passport-facebook-login)

PHPackages © 2026

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