PHPackages                             imanrjb/jwt-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. imanrjb/jwt-auth

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

imanrjb/jwt-auth
================

JWT authentication for Lumen and Laravel

v1.1.5(3y ago)34011MITPHP

Since Jul 24Pushed 3y ago2 watchersCompare

[ Source](https://github.com/ImanRJB/jwt-auth)[ Packagist](https://packagist.org/packages/imanrjb/jwt-auth)[ RSS](/packages/imanrjb-jwt-auth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (20)Used By (1)

Laravel and Lumen Package For JWT
=================================

[](#laravel-and-lumen-package-for-jwt)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0c666575468dfe4bb4ab40f6193d04032e71830a21c70d18078b304e9f748b8b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696d616e726a622f6a77742d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imanrjb/jwt-auth)[![GitHub issues](https://camo.githubusercontent.com/22526ea1e53f6ca30a120c46f0d6ca3a211474d63aa6a4311252636b82ebb2ce/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f496d616e524a422f6a77742d617574683f7374796c653d666c61742d737175617265)](https://github.com/ImanRJB/jwt-auth/issues)[![GitHub stars](https://camo.githubusercontent.com/dcff0ad93a95faf66deffb77a1743b836b82058baf70a6a84e31cf066c7d4eca/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f496d616e524a422f6a77742d617574683f7374796c653d666c61742d737175617265)](https://github.com/ImanRJB/jwt-auth/stargazers)[![GitHub forks](https://camo.githubusercontent.com/4289c265bb75a870c05571467e0cd2a598b2c0ae3237bc09eb2a46176f9644ca/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f496d616e524a422f6a77742d617574683f7374796c653d666c61742d737175617265)](https://github.com/ImanRJB/jwt-auth/network)[![Total Downloads](https://camo.githubusercontent.com/ffef715db54abb3cb9f82c66f505ecc1b9d1a2a27c00e2187494f4bd56b43185/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696d616e726a622f6a77742d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imanrjb/jwt-auth)[![GitHub license](https://camo.githubusercontent.com/a1b81ff250a23b7c69077bd3bb3f0caab2bde7e0cc9cb2cd5ab23ac3bef6fbe6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f496d616e524a422f6a77742d617574683f7374796c653d666c61742d737175617265)](https://github.com/ImanRJB/jwt-auth/blob/master/LICENSE)

⬇️ How to install and config [imanrjb/jwt-auth](https://github.com/ImanRJB/jwt-auth) package?
---------------------------------------------------------------------------------------------

[](#️-how-to-install-and-config-imanrjbjwt-auth-package)

#### Install package

[](#install-package)

```
composer require imanrjb/jwt-auth
```

#### Config package

[](#config-package)

```
// Add this lines in "App\Providers\AuthServiceProvider"

public function boot(): void
{
    $this->app['auth']->viaRequest('api', function ($request) {
        $token = $request->bearerToken();
        if($token) {
            return AccessToken::checkToken($token);
        }
        return;
    });
}
```

```
// Change the "config/auth.php" file

'defaults' => [
    'guard' => 'api',
    'passwords' => 'users',
],

'guards' => [
    'web' => [
        'driver' => 'session',
        'provider' => 'users',
    ],
    'api' => [
        'driver' => 'api',
        'provider' => 'users',
    ],
],
```

```
# Add this items to .env file

JWT_SECRET=GKPMVOCKpMHHJQ3GprVA0EfTKGJi7227mjeKN009Vndls70226raawkRzDoB97AI
ACCESS_TOKEN_LIFETIME=120
REFRESH_TOKEN_LIFETIME=1200
```

📖 How to use in routes as middleware
------------------------------------

[](#-how-to-use-in-routes-as-middleware)

```
Route::get('user', function () {
   return auth()->user();
})->middleware('auth:api');
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~15 days

Recently: every ~55 days

Total

19

Last Release

1114d ago

Major Versions

v0.0.3 → v1.0.02022-07-24

### Community

Maintainers

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

---

Top Contributors

[![ImanR7](https://avatars.githubusercontent.com/u/22983388?v=4)](https://github.com/ImanR7 "ImanR7 (16 commits)")[![imvahid](https://avatars.githubusercontent.com/u/11843776?v=4)](https://github.com/imvahid "imvahid (4 commits)")

### Embed Badge

![Health badge](/badges/imanrjb-jwt-auth/health.svg)

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

###  Alternatives

[google/auth

Google Auth Library for PHP

1.4k272.7M162](/packages/google-auth)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[stevenmaguire/oauth2-keycloak

Keycloak OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[robsontenorio/laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel

5161.1M3](/packages/robsontenorio-laravel-keycloak-guard)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[wp-graphql/wp-graphql-jwt-authentication

JWT Authentication for WPGraphQL

361118.4k1](/packages/wp-graphql-wp-graphql-jwt-authentication)

PHPackages © 2026

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