PHP code example of scaffoldeducation / jwt-manager-php
1. Go to this page and download the library: Download scaffoldeducation/jwt-manager-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
scaffoldeducation / jwt-manager-php example snippets
artisan migratre
// expire and renew is seconds (900 = 15 minutes)
$jwt = new JwtManager(string $appSecret, string $context, int $expire, int $renew);
// generete a new token
$token = $jwt->generate(string $audience, string $subject, array $payload);
// to invalid this token, use:
$jwt->turnInvalid($token);
.\bootstrap\app.php
sh
php sample/jwtManager-sample.php