Skip to content

kalax2/laravel-huaweicloud-obs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

简介

HuaweiCloud OBS filesystem for Laravel

使用方法

安装

composer require kalax2/laravel-huaweicloud-obs

配置

// 在config/filesystems.php中添加相应配置
return [

    /* 其他配置 */
    
    'obs' => [
        'driver' => 'obs',
        'access_key' => env('OBS_ACCESS_KEY'),
        'access_secret' => env('OBS_ACCESS_SECRET'),
        'bucket' => env('OBS_BUCKET'),
        'region' => env('OBS_REGION'),      // 地域,详见 https://console.huaweicloud.com/apiexplorer/#/endpoint/OBS
        'ssl' => env('OBS_SSL', true),      // 是否使用https
        'domain' => env('OBS_DOMAIN', ''),  // 自定义域名
        'guzzle' => []                      // GuzzleHttp配置
    ]
];

使用

Storage::disk('obs')->put('hello.txt', 'world');
Storage::disk('obs')->temporaryUrl('hello.txt', now()->addMinutes(5));

更多用法请看官方文档

About

Huaweicloud OBS Filesystem for Laravel.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages