PHPackages                             maslennikov-yv/jwt-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. maslennikov-yv/jwt-guard

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

maslennikov-yv/jwt-guard
========================

Laravel Guard Package

1.1.0(3y ago)36MITPHP

Since Jan 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/maslennikov-yv/jwt-guard)[ Packagist](https://packagist.org/packages/maslennikov-yv/jwt-guard)[ RSS](/packages/maslennikov-yv-jwt-guard/feed)WikiDiscussions main Synced yesterday

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

Laravel JWT Guard
=================

[](#laravel-jwt-guard)

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

[](#installation)

```
 composer require "maslennikov-yv/jwt-guard"

```

Preparation
-----------

[](#preparation)

Place the following code in the boot() method of AuthServiceProvider

```
Auth::extend('jwt', function ($app, $name, array $config) use ($public_key) {
    return new JwtGuard($provider, $request, function ($token) use ($public_key) {
        try {
            $content = JWT::decode($token, new Key($public_key, 'RS256'));
            return property_exists($content, 'sub') ? $content->sub : null;
        } catch (Exception $e) {
            Log::debug($e->getMessage());
        }
        return null;
    });
});

```

This example uses the Firebase JWT library which requires installation:

```
composer require firebase/php-jwt

```

But you can use any other library that allows you to validate JWT and extract useful data from it

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

[](#configuration)

Configure 'api' guard to use jwt as driver in config/auth.php file

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

```

Testing
-------

[](#testing)

```
composer test

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~103 days

Recently: every ~129 days

Total

6

Last Release

1118d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/608804?v=4)[maslennikov](/maintainers/MaslennikovYV)[@MaslennikovYV](https://github.com/MaslennikovYV)

---

Top Contributors

[![t-w-i](https://avatars.githubusercontent.com/u/475562?v=4)](https://github.com/t-w-i "t-w-i (2 commits)")[![maslennikov-yv](https://avatars.githubusercontent.com/u/20270502?v=4)](https://github.com/maslennikov-yv "maslennikov-yv (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/maslennikov-yv-jwt-guard/health.svg)

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

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[jeremy379/laravel-openid-connect

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

59437.0k9](/packages/jeremy379-laravel-openid-connect)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3417.0k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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