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

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

adrianoalves/jwt
================

Luis Cobucci JWT adapted to use in Laravel

00PHP

Since Apr 19Pushed 3y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

AdrianoAlves/Jwt
================

[](#adrianoalvesjwt)

A JSON Web Token Library made to adapt the **[lcobucci/jwt](https://github.com/lcobucci/jwt)** for Laravel and Lumen.

It uses Asymmetric Algorithm using a **private key** for signature creation and a **public key** for verification. This means that it's fine to distribute your **public key**. However, the **private key** should **remain secret**.

Laravel Installation
--------------------

[](#laravel-installation)

Via composer

```
composer require adrianoalves/jwt

```

Install the package

```
php artisan jwt:install

```

Generate private and public keys

```
php artisan make:jwt-keys

```

Modify the jwt.php in your config file as necessary and add your app's Policies if necessary.

Change the route driver in your auth.php config file to jwt.

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

```

Auth Guard Usage
----------------

[](#auth-guard-usage)

### Routing

[](#routing)

```
Route::middleware('auth:jwt')->get('/user', function (Request $request) {
    return $request->user();
});

// if you set jwt as driver for your api guard
Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

```

### Login

[](#login)

```
// Generate a token for the user if the credentials are valid
$token = Auth::attempt($credentials);

```

### User

[](#user)

```
// Getting the currently authenticated user
$user = Auth::user();

```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![adrianoalves](https://avatars.githubusercontent.com/u/350381?v=4)](https://github.com/adrianoalves "adrianoalves (5 commits)")

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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