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)0181MITPHP

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 today

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

Maintenance34

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

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

632d 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

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k108.5M885](/packages/laravel-socialite)[directorytree/ldaprecord-laravel

LDAP Authentication &amp; Management for Laravel.

5752.3M18](/packages/directorytree-ldaprecord-laravel)[illuminate/auth

The Illuminate Auth package.

10528.2M1.2k](/packages/illuminate-auth)[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

24133.4k](/packages/kovah-laravel-socialite-oidc)

PHPackages © 2026

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