{"repo":"stechstudio/laravel-jwt","free":true,"listed":false,"github":"https://github.com/stechstudio/laravel-jwt","clone":"git clone https://github.com/stechstudio/laravel-jwt.git","description":"Helper package that makes it easy to generate, consume, and protect routes with JWT tokens in Laravel","language":"PHP","stars":124,"topics":["laravel","jwt","jwt-token"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Laravel JWT Tools This package wraps the excellent lcobucci/jwt library with the following benefits: 1) JWT facade with helper methods to quickly generate and parse tokens. 2) Enforces a minimal set of claims for generated tokens, like aud , iss , and exp . 3) Validate parsed tokens to ensure our required claims are set properly with signature present and valid. 4) HTTP Middleware to validate a route-specific JWT 5) Request macro to easily access route-specific JWT claims Requirements - PHP 8.2+ - Laravel 11+ Quickstart Installation Simple example You can generate a simple JWT with the get method. This will generate a token with the ID provided and an array of claims, returning the string token. Lifetime The default token expiration is set to 10 minutes which you can configure, or you can specify a custom lifetime value as a third parameter when creating the token: This token will expire in one hour. You can also specify the lifetime with Carbon: Signing key If you are generating a JWT that will be consumed by a different app (very common use case in our company) you can specify the signing key as the fourth parameter. Configuration This package tries to pick sane defaults, while also allowing you to change configs through your .env file. Signature key Every token is signed. The JWT SIGNING KEY value is used is available, otherwise APP KEY will be used as the signing key. Lifetime Default lifetime is 600 seconds / 10 minutes. You can change the default by specifying the numbe","default_branch":null,"files":null,"tree":[],"storefront":"/r/stechstudio","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/stechstudio/laravel-jwt/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}