PHPackages                             cesg/jwt-token-guard - 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. cesg/jwt-token-guard

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

cesg/jwt-token-guard
====================

Laravel simple JWT token guard

v0.5.0(3y ago)01.5kMITPHPPHP ^7.4|^8.0|^8.1CI failing

Since Jan 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/cesg/jwt-token-guard)[ Packagist](https://packagist.org/packages/cesg/jwt-token-guard)[ RSS](/packages/cesg-jwt-token-guard/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (7)Versions (7)Used By (0)

jwt-token-guard
===============

[](#jwt-token-guard)

Laravel simple JWT token guard

Install
=======

[](#install)

```
composer require cesg/jwt-token-guard
```

Configure
=========

[](#configure)

Configure the auth driver

```
'api' => [
    'driver' => 'jwt',
    'provider' => 'users',
    'key' => env('JWT_KEY', \md5(env('APP_NAME'))),
],
```

Example secret key

```
openssl rand -hex 64
```

Usage
=====

[](#usage)

Javascript
----------

[](#javascript)

```
const token = '';
axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
```

Laravel
-------

[](#laravel)

```
protected function authenticated(Request $request, $user)
{
    $jwt = JWT::encode([
        'sub' => $user->getAuthIdentifier(),
        'iss' => config('app.name'),
        'iat' => now()->timestamp,
    ], config('auth.guards.api.key'));

    session(\compact('jwt'));
}
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Recently: every ~272 days

Total

6

Last Release

1253d ago

PHP version history (4 changes)v0.1.0PHP ^7.2

v0.3.0PHP ^7.3

v0.4.0PHP ^7.4|^8.0

v0.5.0PHP ^7.4|^8.0|^8.1

### Community

Maintainers

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

---

Top Contributors

[![cesg](https://avatars.githubusercontent.com/u/896275?v=4)](https://github.com/cesg "cesg (18 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/cesg-jwt-token-guard/health.svg)

```
[![Health](https://phpackages.com/badges/cesg-jwt-token-guard/health.svg)](https://phpackages.com/packages/cesg-jwt-token-guard)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k108.5M855](/packages/laravel-socialite)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M342](/packages/psalm-plugin-laravel)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M292](/packages/laravel-horizon)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.4k](/packages/illuminate-database)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M183](/packages/laravel-ai)[illuminate/auth

The Illuminate Auth package.

10528.2M1.2k](/packages/illuminate-auth)

PHPackages © 2026

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