PHP code example of alex-qiu / hyperf-express

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

    

alex-qiu / hyperf-express example snippets


use AlexQiu\Express\Express;

$config = [
    // HTTP 请求的超时时间(秒)
    'timeout' => 5.0,

    // 默认配置
    'default' => [
        'gateway' => 'kdniao',
    ],
    // 可用的网关配置
    'gateways' => [
        'kdniao' => [
            'app_id'  => '', // SDK APP ID
            'api_key' => '', // APP KEY
        ],
    ],
];

/**
 * @var Express
 */
public $express;

public function __construct(ExpressInterface $express)
{
    $this->express = $express;
}

public function index()
{
    return $this->express->track([
        "logistic_code" => "JDVA00003618100",
        "shipper_code"  => "JD"
    ]);
}

$ php bin/hyperf.php vendor:publish alex-qiu/hyperf-express