Looking to hire Laravel developers? Try LaraJobs

laravel-filesystem-oss maintained by byrnes2014

Description
A Oss storage filesystem for Laravel.
Author
Last update
2021/04/26 10:51 (dev-main)
License
Links
Downloads
17

Comments
comments powered by Disqus

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