tumainimosha / token-helper
This package is abandoned and no longer maintained.
No replacement package was suggested.
Your Package Description here
0.1.0
2019-08-07 17:07 UTC
Requires
- php: ^7.3
- lcobucci/jwt: ^3.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.14
- fzaninotto/faker: ^1.9@dev
- illuminate/support: ^5.8@dev
- mockery/mockery: ^1.0@dev
- orchestra/database: ^3.8@dev
- orchestra/testbench: ^3.8@dev
- phpunit/phpunit: ^7.4@dev
This package is auto-updated.
Last update: 2023-10-06 19:28:15 UTC
README
Install
composer require tumainimosha/token-helper
Usage
use Tumainimosha\TokenHelper\TokenHelper; // Generating jwt token. jwt is base64 encoded string $jwt_string = (new TokenHelper)->getToken([ 'terminal_id' => $terminal->id, 'token_id' => $tokenModel->id, ], 60 * 24 * 365 * 5); // validating jwt token $helper = new TokenHelper; $status = $helper->validateToken($jwt_string); if ($status === $helper::OK) { //handle success case } elseif ($status === $helper::EXPIRED) { //handle success case } else { // handle invalid token }
Testing
@TODO
vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email princeton.mosha@gmail.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.