PHP code example of hoo / laravel-io

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

    

hoo / laravel-io example snippets


'debug'  => [
    'driver' => 'daily',
    'path'   => storage_path('logs/io/laravel.log'),
    'level'  => 'debug',
    'days'   => 30, # 保留30天 根据具体情况设置
],

$uri = config('http_service.inner_service') . '/api/test';
$res = (new HHttp())->post(
    uri: $uri,
    options: [
        'form_params' => $requestData
    ]
);
$data = $res->getBody()->getContents()
#----------------------------------------------------------------
$uri = config('http_service.inner_service') . '/api/test';
$res = (new HHttp())->post(
    uri: $uri,
    options: [
        'headers' => [
            'Content-Type' => 'application/json'
        ],
        'json' => [
            'card_no' => $account_id,
        ],
    ]
);
$data = $res->getBody()->getContents()

    # 应用hoo自定义的定时
    (new \hoo\io\common\Console\Kernel())->schedule($schedule);