ifelsend / aliyun-oss-adapter
将阿里云OSS用作Laravel 5.0+的存储
1.0.3
2018-12-21 07:10 UTC
Requires
- php: >=5.4.0
- aliyuncs/oss-sdk-php: ^2.3
- league/flysystem: ~1.0
Suggests
- laravel/framework: 5.1.*
This package is not auto-updated.
Last update: 2024-09-22 09:38:56 UTC
README
Laravel 5.0+的阿里云OSS驱动程序,也支持flysystem适配器。
灵感来自 orzcc/aliyun-oss
用法
use Storage; //... Strorage::[everything in doc]
更多信息 更多信息
安装
此包可以通过Composer安装。
composer require aobozhang/aliyun-oss-adapter
配置
必须注册此服务提供者。
// config/app.php 'providers' => [ ..., Aobo\OSS\AliyunOssFilesystemServiceProvider::class, ];
添加配置
// config/filesystem.php.
'oss' => [
'driver' => 'oss',
'access_id' => env('OSS_ACCESS_ID','your id'),
'access_key' => env('OSS_ACCESS_KEY','your key'),
'bucket' => env('OSS_BUCKET','your bucket'),
'endpoint' => env('OSS_ENDPOINT','your endpoint'),
// eg. oss-cn-beijing.aliyuncs.com !!without 'http://' in OSS SDK 2.0+
],
将默认存储改为oss
'default' => 'oss';