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↓50%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 1mo ago

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 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

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

1974d 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

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[olssonm/l5-very-basic-auth

Laravel stateless HTTP basic auth without the need for a database

1662.5M1](/packages/olssonm-l5-very-basic-auth)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)[pschocke/laravel-telegram-login-widget

Easily integrate Telegrams login widget into your Laravel application to send Telegram messages

1610.4k](/packages/pschocke-laravel-telegram-login-widget)

PHPackages © 2026

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