New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

vkoori/laravel-jwt

Integration of firebase/php-jwt library for laravel.
1,004
jwt
Install
composer require vkoori/laravel-jwt
Latest Version:0.1.1
PHP:^8.1
Laravel:8 – 12
Last Updated:Jul 18, 2025
Links: GitHub  ·  Packagist
Maintainer: vkoori

Laravel JWT Integration with Firebase PHP JWT

This package provides a simple way to integrate JWT (JSON Web Tokens) for authentication in your Laravel application using the firebase/php-jwt library.

Installation

To install the package, run the following command:

composer require vkoori/laravel-jwt

Once the package is installed, you need to publish the provider using the following Artisan command:

php artisan vendor:publish --provider="Vkoori\LaravelJwt\JwtServiceProvider"

This will publish the config/jwt-config.php configuration file where you can manage the JWT settings.

Usage

Generating JWT Token

You can generate a JWT token by calling the service as follows:

\Vkoori\LaravelJwt\Services\Jwt::sign()
    ->setAudience($audience)
    ->setSubject($this->getAuthIdentifier())
    ->setScopes($scopes)
    ->setExpirationTime(Carbon::now()->addSeconds($ttl))
    ->encode();

Verifying JWT Token

To verify and decode the JWT token, you can use the following code:

Jwt::verify(token: $token);

Related Packages

vkoori/jwt

Integration of adhocore/jwt library for laravel/lumen.

796 0
vkoori/pgp

This package is used for communication between laravel/lumen services.

794 0
tlx3/laravel-jwt-starter

Boilerplate for using your own API based JWT authentication on Laravel applicati...

305 3
epsoftware/jwt-auth

Auth with jwt

28 1
xaamin/jwt

PHP Implementation of JSON Web token with RSA

10,404 2

Version History

Version Released PHP Laravel License
0.1.1 ^8.1 ^8.0|^9.0|^10.0|^11.0|^12.0
0.1.0 ^8.1 ^8.0|^9.0|^10.0|^11.0|^12.0