PHP code example of lyue / laravel-jwt
1. Go to this page and download the library: Download lyue/laravel-jwt 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/ */
lyue / laravel-jwt example snippets
$xslt
php artisan vendor:publish
$xslt
$payload = [
'user_id'=>123,
'iss'=>'www.baidu.com'
];
$token = \Jwt::getToken($payload);
$xslt
\Jwt::verifyToken($token);
$xslt
\Jwt::set('username',$username);
var_dump(\Jwt::get('username'));