cdxmj / laravel-qingstor-storage
v0.0.2
2019-05-22 02:49 UTC
Requires
- php: >=5.5.9
- league/flysystem: ^1.0
- yunify/qingstor-sdk: ^2.2.4
This package is auto-updated.
Last update: 2025-02-25 15:03:13 UTC
README
关于
Laravel QingStor 文件上传系统,基于青云官方SDK。 推荐使用laravel-upload-manager进行整合。
安装
- Composer 安装
composer require cdxmj/laravel-qingstor-storage
- 下载安装,下载解压缩即可
配置
-
配置青云的API Key和Secret
// 在config/filesystems.php disks数组添加如下代码 'qingstor' => [ 'driver' => 'QingStor', 'bucket' => 'My Bucket', 'zone' => 'My Zone', 'access_key_id' => 'Access ID', // 青云App Key 'secret_access_key' => 'Access Secret', //青云App Secret 'domain' => 'src.xxx.com', 'protocol' => 'http', // 服务使用的协议,如需使用 http,在此配置 http ],
用法
- 简单用法
- 设置为默认上传策略
将 config/filesystems.php default 值改为 "qingstor"
\Storage::put($path, $content);
- 自定义上传策略
\Storage::disk('qingstor')->put($path, $content);
- 设置为默认上传策略
将 config/filesystems.php default 值改为 "qingstor"
- 更多用法请参考 Laravel官方文档