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(2y ago)36MITPHP

Since Jan 8Pushed 2y 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 1mo ago

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

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

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

1065d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64c342491a7ec7d944fc61d1d0a3870da074c22a668a8c6fa5ff91eb0d00ff94?d=identicon)[MaslennikovYV](/maintainers/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

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[overtrue/laravel-follow

User follow unfollow system for Laravel.

1.2k404.7k5](/packages/overtrue-laravel-follow)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)

PHPackages © 2026

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