PHPackages                             jian-kuang/aliyun-oss-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. jian-kuang/aliyun-oss-laravel

ActiveLibrary[File &amp; Storage](/categories/file-storage)

jian-kuang/aliyun-oss-laravel
=============================

alibaba cloud object storage service for laravel

4.2.0(4y ago)06MITPHPPHP ^8.0.2

Since Mar 23Pushed 4y agoCompare

[ Source](https://github.com/jian-kuang/aliyun-oss-laravel)[ Packagist](https://packagist.org/packages/jian-kuang/aliyun-oss-laravel)[ Docs](https://alphasnow.github.io/aliyun-oss-laravel/)[ RSS](/packages/jian-kuang-aliyun-oss-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (6)Versions (20)Used By (0)

English | [简体中文](README-CN.md)

Aliyun Oss Storage for Laravel
==============================

[](#aliyun-oss-storage-for-laravel)

Alibaba Cloud Object Storage Service For Laravel

[![Latest Stable Version](https://camo.githubusercontent.com/06447e45cdc88f74547600518e27a186313ab2b0aaff241601edbebf20a01e07/68747470733a2f2f706f7365722e707567782e6f72672f616c706861736e6f772f616c6979756e2d6f73732d6c61726176656c2f762f737461626c65)](https://packagist.org/packages/alphasnow/aliyun-oss-laravel)[![Total Downloads](https://camo.githubusercontent.com/5ff11640281e0daa6462c9a33600256b3d605267d6908d88cf28a9ffc8a38329/68747470733a2f2f706f7365722e707567782e6f72672f616c706861736e6f772f616c6979756e2d6f73732d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/alphasnow/aliyun-oss-laravel)[![Build Status](https://github.com/alphasnow/aliyun-oss-laravel/workflows/CI/badge.svg)](https://github.com/alphasnow/aliyun-oss-laravel/actions)[![Code Coverage](https://camo.githubusercontent.com/b9c0508925e6c33edc1afdaab609c412458747b261fe587213046dde83163aec/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c706861736e6f772f616c6979756e2d6f73732d6c61726176656c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alphasnow/aliyun-oss-laravel/?branch=master)[![License](https://camo.githubusercontent.com/a340baf14c1064b86e0bee6875e2629c91a30bd641df0c1ff455cc351e879a00/68747470733a2f2f706f7365722e707567782e6f72672f616c706861736e6f772f616c6979756e2d6f73732d6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/alphasnow/aliyun-oss-laravel)[![FOSSA Status](https://camo.githubusercontent.com/628840bde57303ea21716fbf2ce78c222324a51362e131b3ccaf8c336e6bb949/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246616c706861736e6f77253246616c6979756e2d6f73732d6c61726176656c2e7376673f747970653d736869656c64)](https://app.fossa.com/projects/git%2Bgithub.com%2Falphasnow%2Faliyun-oss-laravel?ref=badge_shield)

This package is a wrapper bridging [aliyun-oss-flysystem](https://github.com/alphasnow/aliyun-oss-flysystem) into Laravel as an available storage disk.
If client direct transmission is required, Use web server signature direct transmission OSS extension package [aliyun-oss-appserver](https://github.com/alphasnow/aliyun-oss-appserver).

Compatibility
-------------

[](#compatibility)

laravelaliyun-oss-laraveldoc&gt;=5.5,&lt;9.0^3.0[readme](https://github.com/alphasnow/aliyun-oss-laravel/blob/3.x/README.md)&gt;=9.0^4.0[readme](https://github.com/alphasnow/aliyun-oss-laravel/blob/master/README.md)Installation
------------

[](#installation)

1. If you use the composer to manage project dependencies, run the following command in your project's root directory:

    ```
    $ composer require alphasnow/aliyun-oss-laravel
    ```

    Then run `composer install` to install the dependency.
2. Modify the environment file `.env`

    ```
    OSS_ACCESS_KEY_ID=
    OSS_ACCESS_KEY_SECRET=
    OSS_BUCKET=
    OSS_ENDPOINT=

    ```

    1. (Optional) Modify the configuration file `config/filesystems.php````
        'default' => env('FILESYSTEM_DRIVER', 'oss'),
        // ...
        'disks'=>[
            // ...
            'oss' => [
                'driver'            => 'oss',
                'access_key_id'     => env('OSS_ACCESS_KEY_ID'),           // Required, YourAccessKeyId
                'access_key_secret' => env('OSS_ACCESS_KEY_SECRET'),       // Required, YourAccessKeySecret
                'bucket'            => env('OSS_BUCKET'),                  // Required, For example: my-bucket
                'endpoint'          => env('OSS_ENDPOINT'),                // Required, For example: oss-cn-shanghai.aliyuncs.com
                'internal'          => env('OSS_INTERNAL', null),          // Optional, For example: oss-cn-shanghai-internal.aliyuncs.com
                'domain'            => env('OSS_DOMAIN', null),            // Optional, For example: oss.my-domain.com
                'use_ssl'           => env('OSS_SSL', false),              // Optional, Whether to use HTTPS
                'prefix'            => env('OSS_PREFIX', ''),              // Optional, The prefix of the store path
                'reverse_proxy'     => env('OSS_REVERSE_PROXY', false),    // Optional, Nginx reverse proxy domain
            ],
            // ...
        ]

        ```

Usage
-----

[](#usage)

```
use Illuminate\Support\Facades\Storage;
$storage = Storage::disk('oss');
```

#### Write

[](#write)

```
Storage::disk('oss')->putFile('dir/path', '/local/path/file.txt');
Storage::disk('oss')->putFileAs('dir/path', '/local/path/file.txt', 'file.txt');

Storage::disk('oss')->put('dir/path/file.txt', file_get_contents('/local/path/file.txt'));
$fp = fopen('/local/path/file.txt','r');
Storage::disk('oss')->put('dir/path/file.txt', $fp);
fclose($fp);

Storage::disk('oss')->prepend('dir/path/file.txt', 'Prepend Text');
Storage::disk('oss')->append('dir/path/file.txt', 'Append Text');

Storage::disk('oss')->put('dir/path/secret.txt', 'My secret', 'private');
Storage::disk('oss')->put('dir/path/download.txt', 'Download content', ["headers" => ["Content-Disposition" => "attachment; filename=file.txt"]]);
```

#### Read

[](#read)

```
Storage::disk('oss')->url('dir/path/file.txt');
Storage::disk('oss')->temporaryUrl('dir/path/file.txt', \Carbon\Carbon::now()->addMinutes(30));

Storage::disk('oss')->get('dir/path/file.txt');

Storage::disk('oss')->exists('dir/path/file.txt');
Storage::disk('oss')->size('dir/path/file.txt');
Storage::disk('oss')->lastModified('dir/path/file.txt');
```

#### Delete

[](#delete)

```
Storage::disk('oss')->delete('dir/path/file.txt');
Storage::disk('oss')->delete(['dir/path/file1.txt', 'dir/path/file2.txt']);
```

#### File operation

[](#file-operation)

```
Storage::disk('oss')->copy('dir/path/file.txt', 'dir/path/file_new.txt');
Storage::disk('oss')->move('dir/path/file.txt', 'dir/path/file_new.txt');
Storage::disk('oss')->rename('dir/path/file.txt', 'dir/path/file_new.txt');
```

#### Folder operation

[](#folder-operation)

```
Storage::disk('oss')->makeDirectory('dir/path');
Storage::disk('oss')->deleteDirectory('dir/path');

Storage::disk('oss')->files('dir/path');
Storage::disk('oss')->allFiles('dir/path');

Storage::disk('oss')->directories('dir/path');
Storage::disk('oss')->allDirectories('dir/path');
```

#### Use Macro

[](#use-macro)

```
Storage::disk('oss')->appendObject('dir/path/news.txt', 'The first line paragraph.', 0);
Storage::disk('oss')->appendObject('dir/path/news.txt', 'The second line paragraph.', 25);
Storage::disk('oss')->appendObject('dir/path/news.txt', 'The last line paragraph.', 51);

$position001 = Storage::disk('oss')->appendFile('dir/path/file.zip', 'dir/path/file.zip.001', 0);
$position002 = Storage::disk('oss')->appendFile('dir/path/file.zip', 'dir/path/file.zip.002', $position001);
$position003 = Storage::disk('oss')->appendFile('dir/path/file.zip', 'dir/path/file.zip.003', $position002);
```

Documentation
-------------

[](#documentation)

- [Object storage OSS-aliyun](https://help.aliyun.com/product/31815.html)

Issues
------

[](#issues)

[Opening an Issue](https://github.com/alphasnow/aliyun-oss-laravel/issues/new)

License
-------

[](#license)

[MIT](LICENSE)

[![FOSSA Status](https://camo.githubusercontent.com/6a2aa8c603a2fe0c29d536b57a67cfdbce22287de73226cf80860ddfe1639857/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246616c706861736e6f77253246616c6979756e2d6f73732d6c61726176656c2e7376673f747970653d6c61726765)](https://app.fossa.com/projects/git%2Bgithub.com%2Falphasnow%2Faliyun-oss-laravel?ref=badge_large)

###  Health Score

28

—

LowBetter than 51% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 97.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Recently: every ~14 days

Total

19

Last Release

1574d ago

Major Versions

1.2.0 → 2.0.02021-03-25

2.8.0 → 3.0.02021-08-17

3.x-dev → 4.0.02022-02-25

PHP version history (4 changes)1.2.0PHP &gt;=7.0

2.5.0PHP &gt;=7.0.0

4.0.0PHP ^8.0

4.1.0PHP ^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/a77fc22b826c0ca083f98a0603e8fed18f716b314fae9eaf8e43d8eebad6faf8?d=identicon)[xinfox](/maintainers/xinfox)

---

Top Contributors

[![alphasnow](https://avatars.githubusercontent.com/u/8286647?v=4)](https://github.com/alphasnow "alphasnow (110 commits)")[![WOSHIZHAZHA120](https://avatars.githubusercontent.com/u/52521836?v=4)](https://github.com/WOSHIZHAZHA120 "WOSHIZHAZHA120 (2 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")

---

Tags

laravelstoragefilesystemsaliyunoss

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jian-kuang-aliyun-oss-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/jian-kuang-aliyun-oss-laravel/health.svg)](https://phpackages.com/packages/jian-kuang-aliyun-oss-laravel)
```

###  Alternatives

[jacobcyl/ali-oss-storage

aliyun oss filesystem storage for laravel 5+

522575.7k7](/packages/jacobcyl-ali-oss-storage)[alphasnow/aliyun-oss-laravel

alibaba cloud object storage service for laravel

183284.2k4](/packages/alphasnow-aliyun-oss-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
