PHPackages                             tonylabs/laravel-object-storage-service - 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. tonylabs/laravel-object-storage-service

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

tonylabs/laravel-object-storage-service
=======================================

AliCloud Object Storage Service package for Laravel framework

1.0.1(3y ago)095MITPHPPHP ^8.1

Since Apr 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/tonylabs/laravel-object-storage-service)[ Packagist](https://packagist.org/packages/tonylabs/laravel-object-storage-service)[ RSS](/packages/tonylabs-laravel-object-storage-service/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

Object Storage Service for Laravel
==================================

[](#object-storage-service-for-laravel)

AliCloud Cloud Object Storage Service For Laravel Framework

### Composer

[](#composer)

```
composer require tonylabs/laravel-object-storage-service
```

### Setup .env

[](#setup-env)

```
OSS_ACCESS_KEY_ID=
OSS_ACCESS_KEY_SECRET=
OSS_BUCKET=
OSS_ENDPOINT=

```

### Modify config/filesystems.php

[](#modify-configfilesystemsphp)

```
'default' => env('FILESYSTEM_DRIVER', 'oss'),
#...
'disks' =>[

    'oss' => [
        'driver'            => "oss",
        'access_key_id'     => env('OSS_ACCESS_KEY_ID'),           # Required
        'access_key_secret' => env('OSS_ACCESS_KEY_SECRET'),       # Required
        'bucket'            => env('OSS_BUCKET'),                  # Required
        'endpoint'          => env('OSS_ENDPOINT'),                # Required e.g. oss-cn-shanghai.aliyuncs.com
        'internal'          => env('OSS_INTERNAL', null),          # Optional e.g. oss-cn-shanghai-internal.aliyuncs.com
        "domain"            => env("OSS_DOMAIN", null),            // Optional, For example: oss.my-domain.com
        "is_cname"          => env("OSS_CNAME", false),            // Optional, if the Endpoint is a custom domain name, this must be true, see: https://github.com/aliyun/aliyun-oss-php-sdk/blob/572d0f8e099e8630ae7139ed3fdedb926c7a760f/src/OSS/OssClient.php#L113C1-L122C78
        "prefix"            => env("OSS_PREFIX", ""),              // Optional, The prefix of the store path
        "use_ssl"           => env("OSS_SSL", false),              // Optional, Whether to use HTTPS
        "reverse_proxy"     => env("OSS_REVERSE_PROXY", false),    // Optional, Whether to use the Reverse proxy, such as nginx
        "throw"             => env("OSS_THROW", false),            // Optional, Whether to throw an exception that causes an error
        "options"           => [],                                 // Optional, Add global configuration parameters, For example: [\OSS\OssClient::OSS_CHECK_MD5 => false]
        "macros"            => []                                  // Optional, Add custom Macro, For example: [\App\Macros\ListBuckets::class, \App\Macros\CreateBucket::class]
    ],

]
```

### Init

[](#init)

```
use Illuminate\Support\Facades\Storage;

$objStorage = Storage::disk('oss');
```

### Write

[](#write)

Upload a local file to remote OSS

```
Storage::disk('oss')->putFile('remote/path', 'local/path/file_name.ext');
Storage::disk('oss')->putFileAs('remote/path', 'local/path/file_name.ext', 'new_file_name.ext');
```

Streaming a file content and write into OSS as a file

```
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);
```

Prepend or append new content to a file

```
Storage::disk('oss')->prepend('remote/path/file_name', 'Bring your idea to life in no time.');
Storage::disk('oss')->append('remote/path/file_name', 'Bring your idea to life in no time.');
```

### Read

[](#read)

```
Storage::disk('oss')->url('remote/path/file_name');
Storage::disk('oss')->get('remote/path/file_name');
Storage::disk('oss')->exists('remote/path/file_name');
Storage::disk('oss')->size('remote/path/file_name');
Storage::disk('oss')->lastModified('remote/path/file_name');
```

### Delete

[](#delete)

```
Storage::disk('oss')->delete('remote/path/file_name');
Storage::disk('oss')->delete(['remote/path/file_name_one', 'remote/path/file_name_two']);
```

### File Actions

[](#file-actions)

```
Storage::disk('oss')->copy('remote/path/file_name', 'remote/path/file_name_clone');
Storage::disk('oss')->move('remote/path/file_name', 'remote/path/new_file_name');
Storage::disk('oss')->rename('remote/path/file_name', 'remote/path/new_file_name');
```

### Folder Actions

[](#folder-actions)

```
Storage::disk('oss')->makeDirectory('remote/path/folder_name');
Storage::disk('oss')->deleteDirectory('remote/path/folder_name');
Storage::disk('oss')->files('remote/path/folder');
Storage::disk('oss')->allFiles('remote/path/folder');
Storage::disk('oss')->directories('remote/path/folder');
Storage::disk('oss')->allDirectories('remote/path/folder');
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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 ~0 days

Total

2

Last Release

1127d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fdc9b03a87407e3be07588fc060d77fb3ca5aaeb4a1dad9b4e9679c14d97d4f?d=identicon)[tonylabs](/maintainers/tonylabs)

---

Top Contributors

[![tonylabs](https://avatars.githubusercontent.com/u/34290206?v=4)](https://github.com/tonylabs "tonylabs (12 commits)")

---

Tags

filesystemlaravelstoragealiyunoss

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tonylabs-laravel-object-storage-service/health.svg)

```
[![Health](https://phpackages.com/badges/tonylabs-laravel-object-storage-service/health.svg)](https://phpackages.com/packages/tonylabs-laravel-object-storage-service)
```

###  Alternatives

[jacobcyl/ali-oss-storage

aliyun oss filesystem storage for laravel 5+

523566.2k7](/packages/jacobcyl-ali-oss-storage)[luoyy/ali-oss-storage

aliyun oss filesystem storage for laravel 9+

1529.9k1](/packages/luoyy-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)
