PHP code example of mradang / laravel-oss

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

    

mradang / laravel-oss example snippets


// 跟踪 OSS 对象上传
$schedule
->call(function () {
    try {
        \mradang\LaravelOss\Services\OssService::scheduleTracker();
    } catch (\Exception $e) {
        logger()->warning('OSS 对象跟踪失败:'.$e->getMessage());
    }
})
->cron('* * * * *')
->name('OssService::scheduleTracker')
->withoutOverlapping();

use mradang\LaravelOss\Traits\OssObjectTrait;

// $timeout 生成 URL 的有效期,最长 3600 秒(1 小时)
// $options OSS 数据处理选项
// -- 图片处理 $options['x-oss-process'] = "image/resize,h_${height},w_${width}";
shell
$ php artisan vendor:publish --provider="mradang\\LaravelOss\\LaravelOssServiceProvider"