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

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

imunew/tymon-jwt-auth
=====================

0.4(5y ago)212.0k↓84.8%MITPHPPHP ^7.0|^8.0

Since Apr 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/imunew/tymon-jwt-auth)[ Packagist](https://packagist.org/packages/imunew/tymon-jwt-auth)[ RSS](/packages/imunew-tymon-jwt-auth/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (3)Versions (6)Used By (0)

imunew/tymon-jwt-auth
=====================

[](#imunewtymon-jwt-auth)

[![CircleCI](https://camo.githubusercontent.com/3d32c5fd2739a4880893419a93ca26d953fb7cb5f313046087003d086c76e616/68747470733a2f2f636972636c6563692e636f6d2f67682f696d756e65772f74796d6f6e2d6a77742d617574682e7376673f7374796c653d737667)](https://circleci.com/gh/imunew/tymon-jwt-auth)
This is the Laravel package to extend [tymon/jwt-auth](https://packagist.org/packages/tymon/jwt-auth).

Extended what?
--------------

[](#extended-what)

- Disable the `QueryString`, `InputSource` and `RouteParams` parsers
- Made the `AuthHeaders` parser optional (Default: disabled)
- Prefer the `Cookies` parser
- Made the cookie name changeable
- Add `AuthResource` (with cookie)
- Add `RefreshJwtToken` middleware (with cookie)

Install
-------

[](#install)

```
$ composer require imunew/tymon-jwt-auth
```

`vendor:publish`

```
$ php artisan vendor:publish --provider="Imunew\JWTAuth\Providers\ServiceProvider"
```

Config
------

[](#config)

Set `JWT_AUTH_COOKIE_KEY` environment variable to change the cookie name.

```
JWT_AUTH_COOKIE_KEY={cookie name here}

```

Set `JWT_AUTH_AUTH_HEADER_ENABLED` environment variable to enable the `AuthHeaders` parser.

```
JWT_AUTH_AUTH_HEADER_ENABLED=true

```

Use `AuthResource`
------------------

[](#use-authresource)

Returning `AuthResource` sets JWT token in cookie.

```
// App\Http\Controllers\Auth\Login

    public function __invoke(LoginRequest $request)
    {
        $credentials = $request->only(['login_id', 'password']);
        if (! $token = $this->jwtGuard->attempt($credentials)) {
            throw new AuthenticationException();
        }

        return new AuthResource(new JwtToken($token, $this->factory->getTTL() * 60));
    }
```

Use `RefreshJwtToken`
---------------------

[](#use-refreshjwttoken)

Add `\Imunew\JWTAuth\Middleware\RefreshJwtToken::class` before `\App\Http\Middleware\Authenticate::class`.

```
// App\Http\Kernel

    protected $middlewarePriority = [
        \Illuminate\Session\Middleware\StartSession::class,
        \Illuminate\View\Middleware\ShareErrorsFromSession::class,
        \Imunew\JWTAuth\Middleware\RefreshJwtToken::class,
        \App\Http\Middleware\Authenticate::class,
        \Illuminate\Routing\Middleware\ThrottleRequests::class,
        \Illuminate\Session\Middleware\AuthenticateSession::class,
        \Illuminate\Routing\Middleware\SubstituteBindings::class,
        \Illuminate\Auth\Middleware\Authorize::class,
    ];
```

Add `\Imunew\JWTAuth\Middleware\RefreshJwtToken::class` to `$middlewareGroups`.

```
// App\Http\Kernel

    protected $middlewareGroups = [
        'web' => [
            // ...
        ],

        'api' => [
            'throttle:60,1',
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
            \Imunew\JWTAuth\Middleware\RefreshJwtToken::class,
        ]
    ];
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Total

4

Last Release

2020d ago

PHP version history (2 changes)0.1PHP ^7.0

0.4PHP ^7.0|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3860526?v=4)[Motohiro Imura](/maintainers/imunew)[@imunew](https://github.com/imunew)

---

Top Contributors

[![imunew](https://avatars.githubusercontent.com/u/3860526?v=4)](https://github.com/imunew "imunew (17 commits)")

### Embed Badge

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

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

###  Alternatives

[directorytree/ldaprecord-laravel

LDAP Authentication &amp; Management for Laravel.

5752.3M18](/packages/directorytree-ldaprecord-laravel)[illuminate/auth

The Illuminate Auth package.

10528.2M1.2k](/packages/illuminate-auth)[althinect/filament-spatie-roles-permissions

3481.1M10](/packages/althinect-filament-spatie-roles-permissions)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1563.0k4](/packages/masterix21-laravel-licensing)

PHPackages © 2026

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