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()

    // 本定时任务的作用是清理过期日志文件
    // 具体时间配置见env配置步骤中的CLOCKWORK_STORAGE_EXPIRATION项 默认7天
    $schedule->command(ClockworkCleanCommand::class)->hourly();