JWT Package is used to verify and generate JWT Token.
Add the following code in the composer to install this package into your Laravel Project
"require": {
...
"goapptiv/jwt": "^2.0"
}
"repositories": [
{
"type": "git",
"url": "https://github.com/GoApptiv/jwt-laravel-package"
}
]
Add the Token Key in your .env file.
TOKEN_SECRET_KEY=
Decrypting a Token
use GoApptiv\JWT\JWT;
JWT::decrypt($token);
Encrypting Data
use GoApptiv\JWT\JWT;
JWT::encrypt($data);