PHP code example of aviogram / jwt

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

    

aviogram / jwt example snippets


use Aviogram\JWT\JWT;

$token = JWT::encode(
    JWT::createClaimSet()->setNbf(new DateTime('NOW + 1 DAY')),
    JWT::createEncryptionList()->addHS512Key('mysecret')
);

use Aviogram\JWT\JWT;

$claimSet = JWT::decode(
    $token
    JWT::createEncryptionList()->addHS512Key('mysecret')
);