Generate and verify JSON Web Tokens (JWTs) for Laravel simply
1# Install the package via composer:
2composer require little-apps/littlejwt
3
4# Publish the config file with:
5php artisan vendor:publish --tag="littlejwt-config"
6
7# Generate a secret phrase for building and validating JWTs:
8php artisan littlejwt:phrase
Spend more time developing your Laravel web application and less time fiddling with an overly complicated JSON Web Token library.
Extensive documentation is provided for developers to use Little JWT without having to decipher the source code.
Little JWT is designed so your Laravel web application can handle JSON Web Tokens the way you want it to.
Build JSON Web Tokens without having to jump through hoops. Simply pass in a callback as a parameter and set the claims.
More About Building1use LittleApps\LittleJWT\Facades\LittleJWT;
2use LittleApps\LittleJWT\Build\Builder;
3
4$token = LittleJWT::createToken(function (Builder $builder) {
5 $builder
6 ->abc('def', true)
7 ->ghi('klm')
8 ->nop('qrs', false);
9});
Similiar to building, pass in a callback as a parameter and choose from the various validation rules.
More About Validating1use LittleApps\LittleJWT\Facades\LittleJWT;
2use LittleApps\LittleJWT\Validation\Validator;
3
4$passes = LittleJWT::validateToken($token, function (Validator $validator) {
5 $validator
6 ->valid()
7 ->equals('abc', 'def');
8});