PHP code example of lostinfo / laravel-filesystem-oss

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

    

lostinfo / laravel-filesystem-oss example snippets


'disks' => [
    ...
    'oss' => [
        'driver'     => 'oss',
        'root'       => '',
        'access_key' => env('OSS_ACCESS_KEY'),
        'secret_key' => env('OSS_SECRET_KEY'),
        'bucket'     => env('OSS_BUCKET'),
        'endpoint'   => env('OSS_ENDPOINT'),
        'is_cname'   => env('OSS_IS_CNAME', false),
        'cdn_url'    => env('OSS_CDN_URL'), # 配置后 Storage::url('xxx.png') 返回CDN域名路径
        'buckets'    => [],
    ],
]