PHPackages                             lonelywalkersource/laravel-filesystem-oss - 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. lonelywalkersource/laravel-filesystem-oss

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

lonelywalkersource/laravel-filesystem-oss
=========================================

Alibaba Cloud OSS storage filesystem driver for Laravel.

v1.0.0(1mo ago)02MITPHPPHP ^8.2

Since May 26Pushed 1mo agoCompare

[ Source](https://github.com/lonelywalkersource/laravel-filesystem-oss)[ Packagist](https://packagist.org/packages/lonelywalkersource/laravel-filesystem-oss)[ RSS](/packages/lonelywalkersource-laravel-filesystem-oss/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (8)Versions (10)Used By (0)

lonelywalkersource/laravel-filesystem-oss
=========================================

[](#lonelywalkersourcelaravel-filesystem-oss)

> [中文文档](README-ZH.md)

Alibaba Cloud OSS storage driver for Laravel.

### Requirements

[](#requirements)

- PHP ^8.2
- Laravel ^11.0 | ^12.0 | ^13.0
- lonelywalkersource/flysystem-oss ^1.0

### Installation

[](#installation)

```
composer require lonelywalkersource/laravel-filesystem-oss
```

### Configuration

[](#configuration)

Add an `oss` disk to `config/filesystems.php`:

```
'disks' => [
    // ...
    'oss' => [
        // ── Required ────────────────────────────────────
        'driver'      => 'oss',

        // Alibaba Cloud AccessKey ID (alias: 'key')
        'access_key'  => env('OSS_ACCESS_KEY'),

        // Alibaba Cloud AccessKey Secret (alias: 'secret')
        'secret_key'  => env('OSS_SECRET_KEY'),

        // OSS endpoint, e.g. oss-cn-hangzhou.aliyuncs.com
        'endpoint'    => env('OSS_ENDPOINT', 'oss-cn-hangzhou.aliyuncs.com'),

        // Bucket name
        'bucket'      => env('OSS_BUCKET'),

        // ── Optional ────────────────────────────────────

        // Region (e.g. cn-hangzhou) — required for V4 signature and post policy
        'region'      => env('OSS_REGION', 'cn-hangzhou'),

        // Whether endpoint is a custom domain (CNAME). Default: false
        'isCName'     => false,

        // STS security token (for temporary credentials)
        'security_token' => env('OSS_SECURITY_TOKEN'),

        // CDN domain — when set, Storage::url() returns CDN URLs
        'domain'      => env('OSS_DOMAIN'),

        // Path prefix for all OSS object keys. Default: ''
        'path_prefix' => '',

        // Multi-bucket configuration — see "Multiple Buckets" section below
        'buckets'     => [],

        // Signature version for OSS client, e.g. OssClient::OSS_SIGNATURE_VERSION_V4
        'signature_version' => null,

        // Connection timeout in seconds
        'timeout'     => null,

        // ── Flysystem Options ───────────────────────────

        // Whether to throw exceptions. Default: true
        'throw'       => true,

        // ── OssClient Extra Options ─────────────────────
        // Any key not listed above is passed directly to the OssClient constructor.
        // Valid OssClient options include: request_proxy, forcePathStyle, cloudBoxId,
        // strictObjectName, checkObjectEncoding, filePathCompatible.
        // Example:
        // 'request_proxy' => 'http://proxy.example.com:8080',
    ],
],
```

Add environment variables to `.env`:

```
OSS_ACCESS_KEY=your-access-key
OSS_SECRET_KEY=your-secret-key
OSS_ENDPOINT=oss-cn-hangzhou.aliyuncs.com
OSS_BUCKET=your-bucket
OSS_REGION=cn-hangzhou
OSS_SECURITY_TOKEN=
OSS_DOMAIN=https://cdn.example.com

```

### Usage

[](#usage)

```
// Store a file
Storage::disk('oss')->put('path/to/file.txt', 'Hello OSS');

// Get the URL
$url = Storage::disk('oss')->url('path/to/file.txt');

// Temporary URL
$tempUrl = Storage::disk('oss')->temporaryUrl('path/to/file.txt', now()->addHour());

// Direct access to adapter
$adapter = Storage::disk('oss')->getAdapter();
$postPolicy = $adapter->generatePostPolicy([
    'expire' => 1800,
    'prefix' => 'uploads/',
]);
```

### Multiple Buckets

[](#multiple-buckets)

Add additional disks in `config/filesystems.php`:

```
'oss' => [
    'driver'      => 'oss',
    'access_key'  => env('OSS_ACCESS_KEY'),
    'secret_key'  => env('OSS_SECRET_KEY'),
    'endpoint'    => env('OSS_ENDPOINT'),
    'bucket'      => env('OSS_BUCKET'),
    'region'      => env('OSS_REGION'),
    'buckets'     => [
        'images' => [
            'bucket'   => env('OSS_BUCKET_IMAGES'),
            'endpoint' => env('OSS_ENDPOINT_IMAGES'),
        ],
    ],
],
```

```
// Access secondary bucket via the adapter
$adapter = Storage::disk('oss')->getAdapter();
$imagesAdapter = $adapter->bucket('images');
```

### License

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance94

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~80 days

Recently: every ~129 days

Total

8

Last Release

32d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/81b4ab1385a9e89363131b15f1390935141bf18afc34db5740be66391ace6bfc?d=identicon)[walkerdistance](/maintainers/walkerdistance)

---

Top Contributors

[![lonelywalkersource](https://avatars.githubusercontent.com/u/69964662?v=4)](https://github.com/lonelywalkersource "lonelywalkersource (1 commits)")

---

Tags

filesystemlaravelstoragealiyunoss

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/lonelywalkersource-laravel-filesystem-oss/health.svg)

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

###  Alternatives

[jacobcyl/ali-oss-storage

aliyun oss filesystem storage for laravel 5+

523570.9k7](/packages/jacobcyl-ali-oss-storage)[aobozhang/aliyun-oss-adapter

Use Aliyun oss as Storage for Laravel 5.0+

141.0k](/packages/aobozhang-aliyun-oss-adapter)

PHPackages © 2026

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