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

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

ionghitun/jwt-token
===================

Json web token generation and validation.

3.0.1(5y ago)132.1k1MITPHPPHP &gt;=7.3

Since Dec 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ionghitun/jwt-token)[ Packagist](https://packagist.org/packages/ionghitun/jwt-token)[ Docs](https://github.com/ionghitun/jwt-token)[ RSS](/packages/ionghitun-jwt-token/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (12)Used By (1)

[![Latest Stable Version](https://camo.githubusercontent.com/4d348d451844e749dfaadd96b821d36a9ade85b22abb0380218087e4a263c134/68747470733a2f2f706f7365722e707567782e6f72672f696f6e67686974756e2f6a77742d746f6b656e2f762f737461626c65)](https://packagist.org/packages/ionghitun/jwt-token)[![Build Status](https://camo.githubusercontent.com/002f0e491c909236f6e3ae0a1215defdd26b90589bd6866f8b6165d7bb4c6bb9/68747470733a2f2f7472617669732d63692e636f6d2f696f6e67686974756e2f6a77742d746f6b656e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/ionghitun/jwt-token)[![Total Downloads](https://camo.githubusercontent.com/1a369bf7900d80678e6e70ed5c02966d17434885cb1ed54c2092380f46341004/68747470733a2f2f706f7365722e707567782e6f72672f696f6e67686974756e2f6a77742d746f6b656e2f646f776e6c6f616473)](https://packagist.org/packages/ionghitun/jwt-token)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/370070ea4e458b805cda8a6ba89bd35760548c49c66ed0d4b0efb9fe21401f15/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f696f6e67686974756e2f6a77742d746f6b656e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ionghitun/jwt-token/?branch=master)[![License](https://camo.githubusercontent.com/d471f79aa42afa9d62cb4d2bd3226288c3026ce39c6a0e88a843bd1ab8747da7/68747470733a2f2f706f7365722e707567782e6f72672f696f6e67686974756e2f6a77742d746f6b656e2f6c6963656e7365)](https://packagist.org/packages/ionghitun/jwt-token)

Jwt Token
=========

[](#jwt-token)

Json web token generation and validation.

Instalation notes
-----------------

[](#instalation-notes)

`$ composer require ionghitun/jwt-token`

Dependencies
------------

[](#dependencies)

- php &gt;= 7.3

Documentation:
--------------

[](#documentation)

You need to add `JWT_SECRET` to your `.env` file.

Import `Jwt` from `IonGhitun\JwtToken`

- use `Jwt::generateToken($payload)` to generate a token, `$payload` should be an array.
- use `Jwt::validateToken($token)` to validate a token.

Validity of the token is default one day. It can be overwritten by adding expiration to `$payload`:

```
    $payload['expiration'] = Carbon::now()->addDay()->format('Y-m-d H:i:s');

```

In case `$token` is not a valid Jwt token, expired or could not verify signature with secret a `IonGhitun\JwtToken\Exceptions\JwtException` will be thrown on `validateToken`method.

*Happy coding!*

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~37 days

Recently: every ~86 days

Total

11

Last Release

2014d ago

Major Versions

1.2.1 → 2.0.02020-04-07

2.0.1 → 3.0.02020-12-26

PHP version history (3 changes)1.0PHP &gt;=7.1

1.1.1PHP &gt;=7.2

3.0.0PHP &gt;=7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13887807?v=4)[Ion Ghitun](/maintainers/ionghitun)[@ionghitun](https://github.com/ionghitun)

---

Top Contributors

[![ionghitun](https://avatars.githubusercontent.com/u/13887807?v=4)](https://github.com/ionghitun "ionghitun (13 commits)")

---

Tags

expirationjwtlumentokenjwtlumentokenionghitun

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.7k51.8M370](/packages/tymon-jwt-auth)[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k103.2M104](/packages/namshi-jose)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

84611.1M63](/packages/php-open-source-saver-jwt-auth)[adhocore/jwt

Ultra lightweight JSON web token (JWT) library for PHP5.5+.

3031.8M29](/packages/adhocore-jwt)[corbosman/laravel-passport-claims

Add claims to Laravel Passport JWT Tokens

88739.1k](/packages/corbosman-laravel-passport-claims)[psecio/jwt

A JWT (JSON Web Token) Encoding &amp; Decoding library

109362.5k2](/packages/psecio-jwt)

PHPackages © 2026

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