PHPackages                             kamrul-haque/laravel-passport-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. kamrul-haque/laravel-passport-auth

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

kamrul-haque/laravel-passport-auth
==================================

Authentication functionality for API using Laravel Passport

v1.0.0(3y ago)1161MITPHP

Since Dec 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Kamrul-Haque/laravel-passport-auth)[ Packagist](https://packagist.org/packages/kamrul-haque/laravel-passport-auth)[ RSS](/packages/kamrul-haque-laravel-passport-auth/feed)WikiDiscussions master Synced 1mo ago

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

laravel-passport-auth
=====================

[](#laravel-passport-auth)

[![Latest Stable Version](https://camo.githubusercontent.com/156defbb4a5700622e303b6c02a3dac620f88cb7c11303a80d92d3f9a68ceb43/687474703a2f2f706f7365722e707567782e6f72672f6b616d72756c2d68617175652f6c61726176656c2d70617373706f72742d617574682f76)](https://packagist.org/packages/kamrul-haque/laravel-passport-auth) [![Total Downloads](https://camo.githubusercontent.com/f5dc13f271a2397ef88dec624c0a86654ff3bc39256e2868178df8ae97b96a32/687474703a2f2f706f7365722e707567782e6f72672f6b616d72756c2d68617175652f6c61726176656c2d70617373706f72742d617574682f646f776e6c6f616473)](https://packagist.org/packages/kamrul-haque/laravel-passport-auth) [![Latest Unstable Version](https://camo.githubusercontent.com/09a1a9e2993df25aee8922f46ff4c8ee26f7c2736153c5d20e95cad3ef2a3258/687474703a2f2f706f7365722e707567782e6f72672f6b616d72756c2d68617175652f6c61726176656c2d70617373706f72742d617574682f762f756e737461626c65)](https://packagist.org/packages/kamrul-haque/laravel-passport-auth) [![License](https://camo.githubusercontent.com/e31dc0fe65dff24d7a4d1f648d676ae3e3d1065bdafda82cf3c8b6448d821854/687474703a2f2f706f7365722e707567782e6f72672f6b616d72756c2d68617175652f6c61726176656c2d70617373706f72742d617574682f6c6963656e7365)](https://packagist.org/packages/kamrul-haque/laravel-passport-auth) [![GitHub Repo stars](https://camo.githubusercontent.com/2df7f6dee6326ab6ca22370b2dcf2a838bc67eb12016e9afec3fdafa5a0937b8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f4b616d72756c2d48617175652f6c61726176656c2d70617373706f72742d617574683f636f6c6f723d463442443136)](https://camo.githubusercontent.com/2df7f6dee6326ab6ca22370b2dcf2a838bc67eb12016e9afec3fdafa5a0937b8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f4b616d72756c2d48617175652f6c61726176656c2d70617373706f72742d617574683f636f6c6f723d463442443136)

Authentication functionality for API using Laravel Passport

Prerequisite
------------

[](#prerequisite)

Install and configure [Laravel Passpost](https://laravel.com/docs/9.x/passport)

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

[](#installation)

Install the package via [composer](https://getcomposer.org/):

```
composer require kamrul-haque/laravel-passport-auth

```

Publish package resources:

```
php artisan vendor:publish --tag="laravel-passport-auth"

```

Migrate the necessary database tables:

```
php artisan migrate

```

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

[](#configuration)

Set the required configuration in `.env`.

```
// .env

FRONTEND_URL=
FRONTEND_IP=
TOKEN_EXPIRY_DAYS=
TOKEN_REFRESH_EXPIRY_DAYS=

```

Usage:
------

[](#usage)

Add `routes` in `api.php`:

```
// routes/api.php

include __DIR__ . '/passport.php';

```

Protect `routes`:

```
// routes/api.php

Route::group(['middleware' => 'auth:api'], function () {
  // your routes
});

```

Register `middleware` in `app\Http\Kernel.php` inside `$routeMiddleware` array if you want to restrict API calls from certain IP address:

```
// app\Http\Kernel.php

protected $routeMiddleware = [
  // existing middlewares

  'restrict-request-ip' => \App\Http\Middleware\RestrictRequestIP::class,
];

```

Assign the `middleware` to `routes`:

```
// routes/api.php

Route::group(['middleware' => 'restrict-request-ip'], function () {
  // your routes
});

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

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

1232d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7cc3b68d9f7568893b90c5f63f333fdd80b7d68779a6cb08d73a8a74710ef749?d=identicon)[Kamrul-Haque](/maintainers/Kamrul-Haque)

---

Top Contributors

[![Kamrul-Haque](https://avatars.githubusercontent.com/u/72596604?v=4)](https://github.com/Kamrul-Haque "Kamrul-Haque (7 commits)")

### Embed Badge

![Health badge](/badges/kamrul-haque-laravel-passport-auth/health.svg)

```
[![Health](https://phpackages.com/badges/kamrul-haque-laravel-passport-auth/health.svg)](https://phpackages.com/packages/kamrul-haque-laravel-passport-auth)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[overtrue/laravel-follow

User follow unfollow system for Laravel.

1.2k404.7k5](/packages/overtrue-laravel-follow)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

55342.3k2](/packages/jeremy379-laravel-openid-connect)

PHPackages © 2026

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