PHP code example of bravist / cnvex

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

    

bravist / cnvex example snippets




'providers' => [
    //...
    Bravist\Cnvex\ServiceProvider::class,
],

'aliases' => [
    'Cnvex' => Bravist\Cnvex\Facade\Cnvex::class,
    'CnvexSigner' => Bravist\Cnvex\Facade\Signature::class
],

# 数据签名
CnvexSigner::sign(['tody' => 'hello']);

# 数据验签
CnvexSigner::verify(['today' => 'hello'], 'hello'); // false

CnvexSigner::verify(['tody' => 'hello'], 'c8ef86e1cab2e2daeabdc9c516120463'); // true


# 查询企账通用户信息,更多接口参考下面开放接口部分
Cnvex::queryUser('17090516435200300009');



...
// $app->withEloquent();
$app->register(Bravist\Cnvex\ServiceProvider::class);
...
 php

php artisan vendor:publish --provider="Bravist\Cnvex\ServiceProvider"