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

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

qufo/jwt
========

Simple Json Web Token toolkit

417PHP

Since Dec 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/qufo/JWT)[ Packagist](https://packagist.org/packages/qufo/jwt)[ RSS](/packages/qufo-jwt/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

JWT
===

[](#jwt)

Simple JSON Web Token Toolkit for Lumen.

Install
=======

[](#install)

add

```
    "qufo/jwt":"dev-master"

```

to your composer.json, and composer update.

Configure
=========

[](#configure)

add the below to your .env file like

```
[JWT]
JWT_SECRET=YOURSECRETWITH32CHARSET
JWT_ALGO=SHA256
JWT_ENABLE=true
JWT_TTL=60
JWT_REFRESH_TTL=60

```

add

```
$app->register(Qufo\JWT\Provider\LumenServiceProvider::class);

```

to your bootstrap/app.php.

How to use
==========

[](#how-to-use)

1. Build a Token first. at any place of your code, like

```
    $jwt_token = \Qufo\JWT\JWT::encode($payload);

```

and bring it up to your client, so the client can take and remember it .

2. Build a Middleware at app/Http/Middleware names JWTAuth.php

```
