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

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

imrancse94/jwt
==============

This is jwt token generation library for Laravel application.

1.0.1(1y ago)016MITPHP

Since Jul 10Pushed 1y ago1 watchersCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (0)

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

[](#installation)

1. `composer require imrancse94/jwt`
2. `php artisan generate:jwt-secret` After running the command, it will update `.env` file by below variables.

```
JWT_SECRET=
JWT_ACCESS_TOKEN_EXPIRY=3600 // in seconds
JWT_REFRESH_TOKEN_EXPIRY=84000 // in seconds
```

3. Go to `config/auth.php` set driver `jwt`. For example,

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

Usage
-----

[](#usage)

```
auth()->attempt($credentials); // it will return access token and refresh token with access token life time.

{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3MjA2MzE3MjMsInR5cGUiOiJhY2Nlc3NfdG9rZW4iLCJleHAiOjE3MjA2MzUzMjMsInBheWxvYWQiOnsiYXV0aF9pZCI6M319.OkiE7tiX1rlAc23rU1zhV6252bODgdma97KfRAjAuo4",
    "expire_in": 3600, // in seconds
    "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3MjA2MzE3MjMsInR5cGUiOiJyZWZyZXNoX3Rva2VuIiwiZXhwIjoxNzIwNzE1NzIzLCJwYXlsb2FkIjp7ImF1dGhfaWQiOjN9fQ.iqiBvcw3ezrBFgR3hVP7aDLPjvge9GLQiTM9MWrA0F8"
}

auth()->refreshToken()  // it will return access token and refresh token with access token life time and user information

{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3MjA2MzMwMjEsInR5cGUiOiJhY2Nlc3NfdG9rZW4iLCJleHAiOjE3MjA2MzY2MjEsInBheWxvYWQiOnsiYXV0aF9pZCI6M319.3kElMASkE2nSJSCvoDq6EzA0zvfISJB5Y2Z-gntfgi4",
    "expire_in": 3600, // in seconds
    "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3MjA2MzMwMjEsInR5cGUiOiJyZWZyZXNoX3Rva2VuIiwiZXhwIjoxNzIwNzE3MDIxLCJwYXlsb2FkIjp7ImF1dGhfaWQiOjN9fQ.c8gfCiLfbUPNSTICtku9SZqFuppOrxg0_zoBLDkyrVQ",
    "user": {
        "id": 3,
        "name": "Imran Hossain",
        "email": "imrancse94@gmail.com",
        "email_verified_at": null,
        "created_at": "2024-06-19T11:54:22.000000Z",
        "updated_at": "2024-06-19T11:54:22.000000Z"
    }
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

Total

2

Last Release

667d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b73abfa9280ef9912bf1679661af2f33ccf605b447a8be99978d2cd9a68ed9a?d=identicon)[imrancse94](/maintainers/imrancse94)

---

Top Contributors

[![imrancse94](https://avatars.githubusercontent.com/u/27916046?v=4)](https://github.com/imrancse94 "imrancse94 (6 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/imrancse94-jwt/health.svg)](https://phpackages.com/packages/imrancse94-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)
