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

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

d4v/php-jwt
===========

D4v JWT is an implementation of firebase/php-jwt for Laravel

2.0.1.x-dev(1y ago)0177MITPHP

Since Oct 1Pushed 1y ago1 watchersCompare

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

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

php-jwt for Laravel
===================

[](#php-jwt-for-laravel)

`Version 2.0.0 is compatible with Illuminate Support 10 and 11`

This package provides a convenient way to use the lib firebase/php-jwt  in Laravel.

- Call methods `encode()` and `decode()` via facade
- Set up your configuration in a config file for convenience

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

[](#installation)

```
composer req d4v/php-jwt
```

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

[](#configuration)

```
php artisan vendor:publish --tag=config
```

The config file allows you to set issuer (from), secret (private key), algorythm (how to encrypt data) and ttl (time to live).

```
return [
    'issuer' => env('APP_URL', 'who-sent-the-token'),
    'secret' => env('JWT_SECRET', 'your-key-here'),
    'algo' => 'HS256',
    'ttl' => 3600, // Expiration in seconds
];
```

### This command can generate a key for you depending of your needs

[](#this-command-can-generate-a-key-for-you-depending-of-your-needs)

```
php artisan key:generate --show
```

How to use
----------

[](#how-to-use)

### Simple way

[](#simple-way)

In its simplest form, the lib can help you generate a JWT this fast:

```
use D4v\JWT\Facades\JWT;

$token = JWT::encode(['sub'=> 1]);
```

You can also set your parameters entirely at runtime if needed:

```
payload = [
    'iss' => 'https://mydomain.tld',
    'sub' => 1,
    'iat' => time(),
    'exp' => time() + 60 * 10
];

JWT::encode($payload);
```

Call the `decode()` method to restore the data :

```
$decoded = JWT::decode($token);
```

More info about firebase/php-jwt can be found here :

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity27

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

586d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b5cabada3b9774bf1148d1363ec228d366334fae55ce72b0dc80468a06bcab5?d=identicon)[dcourtin](/maintainers/dcourtin)

---

Top Contributors

[![dcourtin](https://avatars.githubusercontent.com/u/681247?v=4)](https://github.com/dcourtin "dcourtin (1 commits)")

### Embed Badge

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

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

###  Alternatives

[robsontenorio/laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel

5161.1M3](/packages/robsontenorio-laravel-keycloak-guard)[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

2073.7k](/packages/kovah-laravel-socialite-oidc)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)[vinkas/firebase-auth-laravel

Firebase Authentication package for Laravel PHP Framework

392.1k](/packages/vinkas-firebase-auth-laravel)[pschocke/laravel-telegram-login-widget

Easily integrate Telegrams login widget into your Laravel application to send Telegram messages

1610.4k](/packages/pschocke-laravel-telegram-login-widget)

PHPackages © 2026

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