PHPackages                             goodgay/huaweiobs - 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. goodgay/huaweiobs

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

goodgay/huaweiobs
=================

Object Storage Service (OBS) provides massive, secure, highly reliable, and low-cost data storage capabilities, allowing users to store data of any type and size. It is suitable for various data storage scenarios such as enterprise backup/archiving, video on demand, and video surveillance.

0.9.6(5y ago)33.7k1MITPHPPHP ^7.3

Since Dec 9Pushed 5y ago1 watchersCompare

[ Source](https://github.com/fuzuchang/laravel-huaweiobs)[ Packagist](https://packagist.org/packages/goodgay/huaweiobs)[ RSS](/packages/goodgay-huaweiobs/feed)WikiDiscussions master Synced 1w ago

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

Laravel-HuaWeiOBS
=================

[](#laravel-huaweiobs)

An easy way to use the [official php sdk client](https://support.huaweicloud.com/sdk-php-devg-obs/obs_28_0100.html) in your Laravel or Lumen applications.

- [Installation and Configuration](#installation-and-configuration)
    - [Laravel](#laravel)
        - [Alternative configuration method via .env file](#alternative-configuration-method-via-env-file)
    - [Lumen](#lumen)
- [Usage](#usage)
- [Advanced Usage](#advanced-usage)
- [Bugs, Suggestions and Support](#bugs-suggestions-and-support)
- [Copyright and License](#copyright-and-license)

Installation and Configuration
------------------------------

[](#installation-and-configuration)

Install the current version of the `goodgay/huaweiobs` package via composer:

```
composer require goodgay/huaweiobs
```

### Laravel

[](#laravel)

The package's service provider will automatically register its service provider.

Publish the configuration file:

```
php artisan vendor:publish --provider="Goodgay\HuaweiOBS\HWOBSServiceProvider"
```

##### Alternative configuration method via .env file

[](#alternative-configuration-method-via-env-file)

After you publish the configuration file as suggested above, you may configure OBS by adding the following to your application's `.env` file (with appropriate values):

```
HWOBS_ACCESS_KEY_ID=5RXYW9YKK
HWOBS_SECRET_ACCESS_KEY=NBHXP7UEBqNu
HWOBS_DEFAULT_REGION=region
HWOBS_BUCKET=test
HWOBS_URL=
HWOBS_ENDPOINT=https://obs.cn-south-1.myhuaweicloud.com
```

### Lumen

[](#lumen)

If you work with Lumen, please register the service provider and configuration in `bootstrap/app.php`:

```
$app->register(Goodgay\HuaweiOBS\HWOBSServiceProvider::class);
$app->configure('hwobs');
```

Manually copy the configuration file to your application.

Usage
-----

[](#usage)

The `HWobs` facade is just an entry point into the [php-obs sdk](https://github.com/huaweicloud/huaweicloud-sdk-php-obs), so previously you might have used:

```
use ObsV3\ObsClient;
$obsClient = ObsClient::factory ( [
		'key' => $ak,
		'secret' => $sk,
		'endpoint' => $endpoint,
		'socket_timeout' => 30,
		'connect_timeout' => 10
] );

$resp = $obsClient -> listObjects(['Bucket' => $bucketName]);
foreach ( $resp ['Contents'] as $content ) {
    printf("\t%s etag[%s]\n", $content ['Key'], $content ['ETag']);
}
printf("\n");

```

You can now replace those last two lines with simply:

```
use Goodgay\HuaweiOBS\HWobs;

$return = HWobs::all();

//or

$return = HWobs::obs()->listObjects(['Bucket' => $bucketName]);
```

Lumen users who wish to use Facades can do so by editing the `bootstrap/app.php` file to include the following:

```
$app->withFacades(true,[
     Goodgay\HuaweiOBS\HWobs::class  => 'Hwobs'
]);
```

```
// 文件系统的配置文件位于 config/filesystems.php
'hwobs' => [
    'driver'    => 'hwobs',
    'key'       => env('HWOBS_ACCESS_KEY_ID',''),
    'secret'    => env('HWOBS_SECRET_ACCESS_KEY',''),
    'region'    => env('HWOBS_DEFAULT_REGION',''),
    'bucket'    => env('HWOBS_BUCKET',''),
    'url'       => env('HWOBS_URL',''),
    'endpoint'  => env('HWOBS_ENDPOINT',''),
    'exceptionResponseMode'  => false,
],

Storage::disk('hwobs')->put('file.txt', 'Contents');
```

Advanced Usage
--------------

[](#advanced-usage)

Because the package is a wrapper around the official php-obs sdk, you can do pretty much anything with this package.

To upload:

```
$resp = HWobs::putText("object-name","some content");
$resp = HWobs::putFile("object-name","./some.txt");
```

To download:

```
$resp = HWobs::getText("object-name");
$resp = HWobs::getStream("object-name");
$resp = HWobs::getFile("object-name",'save_path.txt');
```

To manage objects:

```
$resp = HWobs::getMetadata("object-name");
$resp = HWobs::delete("object-name");
$resp = HWobs::all();
$resp = HWobs::deleteMulti(['object-name1','object-name2']);
```

Bugs, Suggestions and Support
-----------------------------

[](#bugs-suggestions-and-support)

Special thanks to [Visual Studio Code](https://code.visualstudio.com/?from=goodgay/huaweiobs) for their Open Source License Program ... and the excellent IDE, of course!

Please use [Github](https://github.com/fuzuchang/laravel-huaweiobs) for reporting bugs, and making comments or suggestions.

Copyright and License
---------------------

[](#copyright-and-license)

[laravel-huaweiobs](https://github.com/fuzuchang/laravel-huaweiobs)was written by [fuzuchang](https://github.com/fuzuchang/laravel-huaweiobs) and is released under the [MIT License](LICENSE.md).

Copyright (c) 2020 fuzuchang

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

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

Total

7

Last Release

2034d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2706561?v=4)[fuzuchang](/maintainers/fuzuchang)[@fuzuchang](https://github.com/fuzuchang)

---

Top Contributors

[![fuzuchang](https://avatars.githubusercontent.com/u/2706561?v=4)](https://github.com/fuzuchang "fuzuchang (10 commits)")

---

Tags

laravelOBShuaweiobsesdk-obs-php

### Embed Badge

![Health badge](/badges/goodgay-huaweiobs/health.svg)

```
[![Health](https://phpackages.com/badges/goodgay-huaweiobs/health.svg)](https://phpackages.com/packages/goodgay-huaweiobs)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.9k556.2M21.2k](/packages/laravel-framework)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k293.8M1.1k](/packages/league-flysystem-aws-s3-v3)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.6M90](/packages/unisharp-laravel-filemanager)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k19](/packages/tempest-framework)[masbug/flysystem-google-drive-ext

Flysystem adapter for Google Drive with seamless virtual&lt;=&gt;display path translation

2702.3M19](/packages/masbug-flysystem-google-drive-ext)[jerodev/flysystem-v3-smb-adapter

SMB adapter for Flysystem v3

13102.6k1](/packages/jerodev-flysystem-v3-smb-adapter)

PHPackages © 2026

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