byrnes2014/laravel-filesystem-oss

A Oss storage filesystem for Laravel.

0.0.1 2021-04-26 08:16 UTC

This package is auto-updated.

Last update: 2024-04-26 19:32:01 UTC


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