PHP code example of homevip / token

1. Go to this page and download the library: Download homevip/token 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/ */

    

homevip / token example snippets


use homevip;

$Token = Token::instance()
    ->exp(60)
    ->aud('public_*')
    ->sub('zhangsan');

$encode = $Token->encrypt([
    'id' => 100,
    'name' => '张三',
]);

$decode = $Token->decrypt($encode);