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

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

yosmelvin/jwt-guard
===================

JWT Guard for Laravel 5.\*

0.1.4(9y ago)011MITPHPPHP &gt;=5.5.9

Since Mar 2Pushed 8y ago1 watchersCompare

[ Source](https://github.com/yosmelvin/jwt-guard)[ Packagist](https://packagist.org/packages/yosmelvin/jwt-guard)[ RSS](/packages/yosmelvin-jwt-guard/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

JWT-Guard
---------

[](#jwt-guard)

JWT-Guard is a Laravel package that allow authentication and authorization as a guard driver using JWT tokens.

This package was forked from paulvl/jwt-guard.

**Quick Installation**
----------------------

[](#quick-installation)

Begin by installing this package through Composer.

You can run:

```
composer require yosmelvin/jwt-guard 0.*

```

Or edit your project's composer.json file to require yosmelvin/jwt-guard.

```
    "require": {
        "yosmelvin/jwt-guard": "0.*"
    }

```

Next, update Composer from the Terminal:

```
composer update

```

Once the package's installation completes, the final step is to add the service provider. Open `config/app.php`, and add a new item to the providers array:

```
LucasRomano\JWTGuard\Auth\AuthServiceProvider::class,

```

Finally publish package's configuration file:

```
php artisan vendor:publish --provider="LucasRomano\JWTGuard\Auth\AuthServiceProvider"

```

Then the file `config/jwt.php` will be created.

**JWT Guard**
-------------

[](#jwt-guard-1)

### **JWT driver setup!**

[](#jwt-driver-setup)

To start using JWT drive you need to create anew guard on `config/auth.php` file:

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

```

You can use any `Eloquent` provider that you want.

\###**Using JWT Guard**

\####**attempt**

```
	// Assuming you retrieve your credentials from request
	$credentials = [
		'email' => 'test@example.com',
		'password' => 'password'
	];
	//this will return a token array
	return Auth::guard('jwt')->attempt($credentials);

```

\####**blacklistToken**

```
	//this will blacklist current jwt-token and referenced refresh token if exists
	return Auth::guard('jwt')->blacklistToken();

```

\###**Using JWT Middleware**

if you need to validate JWT token request just add `LucasRomano\JWTGuard\Auth\Middleware\AuthenticateJwt::class` to `routeMiddleware` on `Http/Kernel.php` file:

```
protected $routeMiddleware = [
        ...
        'auth-jwt' => \LucasRomano\JWTGuard\Auth\Middleware\AuthenticateJwt::class,
        ...
    ];

```

**Contribute and share ;-)**
----------------------------

[](#contribute-and-share--)

If you like this little piece of code share it with you friends and feel free to contribute with any improvements.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 54.5% 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 ~58 days

Total

5

Last Release

3483d ago

### Community

Maintainers

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

---

Top Contributors

[![yosmelvin](https://avatars.githubusercontent.com/u/8221068?v=4)](https://github.com/yosmelvin "yosmelvin (6 commits)")[![lucasromanojf](https://avatars.githubusercontent.com/u/3661610?v=4)](https://github.com/lucasromanojf "lucasromanojf (5 commits)")

---

Tags

jwtlaravelguard

### Embed Badge

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

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

###  Alternatives

[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M52](/packages/php-open-source-saver-jwt-auth)[corbosman/laravel-passport-claims

Add claims to Laravel Passport JWT Tokens

88655.9k](/packages/corbosman-laravel-passport-claims)[paulvl/jwt-guard

JWT Guard for Laravel 5.\*

1518.0k1](/packages/paulvl-jwt-guard)[benbjurstrom/cognito-jwt-guard

A laravel auth guard for JSON Web Tokens issued by Amazon AWS Cognito

1113.1k](/packages/benbjurstrom-cognito-jwt-guard)

PHPackages © 2026

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