byrnes2014 / laravel-filesystem-oss
A Oss storage filesystem for Laravel.
0.0.1
2021-04-26 08:16 UTC
Requires
- php: ^7.2.5 || ^8.0
- byrnes2014/flysystem-oss: ^0.0.1
- league/flysystem: ^1.0
README
.
Installing
$ composer require byrnes2014/laravel-filesystem-oss -vvv
Then in your config/app.php
add this line to providers array:
Jacobcyl\AliOSS\AliOssServiceProvider::class,
Contributing
'disks'=>[ ... 'oss' => [ 'driver' => 'oss', 'access_id' => '<Your Aliyun OSS AccessKeyId>', 'access_key' => '<Your Aliyun OSS AccessKeySecret>', 'bucket' => '<OSS bucket name>', 'endpoint' => '<the endpoint of OSS, E.g: oss-cn-hangzhou.aliyuncs.com | custom domain, E.g:img.abc.com>', 'isCName' => <true|false> 'debug' => <true|false> ], ... ]
Usage
use Illuminate\Support\Facades\Storage;
Then You can use all APIs of laravel Storage
Storage::disk('oss'); // if default filesystems driver is oss, you can skip this step Storage::put('path/to/file/file.jpg', $contents)
License
MIT