PHPackages                             chenhua/laravel5-aliyun-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. chenhua/laravel5-aliyun-oss

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

chenhua/laravel5-aliyun-oss
===========================

Aliyun OSS Package for Laravel 5

v1.0.4(7y ago)04.3k[1 issues](https://github.com/ichenhua/laravel5-aliyun-oss/issues)MITPHP

Since Sep 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ichenhua/laravel5-aliyun-oss)[ Packagist](https://packagist.org/packages/chenhua/laravel5-aliyun-oss)[ Docs](http://www.81f7.com)[ RSS](/packages/chenhua-laravel5-aliyun-oss/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Laravel5-Aliyun-Oss
-------------------

[](#laravel5-aliyun-oss)

```
    ___     __    _                                    ____    _____   _____
   /   |   / /   (_)   __  __  __  __   ____          / __ \  / ___/  / ___/
  / /| |  / /   / /   / / / / / / / /  / __ \        / / / /  \__ \   \__ \
 / ___ | / /   / /   / /_/ / / /_/ /  / / / /       / /_/ /  ___/ /  ___/ /
/_/  |_|/_/   /_/    \__, /  \__,_/  /_/ /_/        \____/  /____/  /____/
                    /____/

```

Laravel5-Aliyun-Oss 是阿里云 OSS 官方 SDK 的 Composer 封装，支持 Laravel5 项目。

更新记录
----

[](#更新记录)

- 2017-10-23 `Release v1.0.3` 获取文件内容方法更改为curl方式
- 2017-10-05 `Release v1.0.2` 修改取文件后缀方法
- 2017-09-25 `Release v1.0.1` 文件后缀转小写，添加组件使用demo
- 2017-09-20 `Release v1.0.0` 引入aliyunOss2.0，封装根据 url 上传文件方法。

安装流程
----

[](#安装流程)

1、安装的两种方式

① 直接编辑配置文件

将以下内容增加到 composer.json：

```
require: {
    "chenhua/laravel5-aliyun-oss": "~1.0"
}
```

然后运行 `composer update`。

② 执行命令安装

运行命令：

```
composer require chenhua/laravel5-aliyun-oss
```

2、完成上面的操作后，修改 `config/app.php` 中 `providers` 数组

```
Chenhua\AliyunOss\AliyunOssServiceProvider::class,
```

3、修改 `config/app.php` 中 `aliases` 数组

```
'AliyunOss' => Chenhua\AliyunOss\Facades\AliyunOss::class,
```

4、执行 `artisan` 命令，生成 `config/aliyun.php` 配置文件

```
php artisan vendor:publish --tag=aliyun.oss
```

5、`.env` 添加配置项

```
#Aliyun配置
OSS_AK_ID=LTAIXRSmr9DtWAxxx
OSS_AK_SECRET=vkRN73GgWMhDkCZr5tNdjPutxxxxx
OSS_ENDPOINT=oss-cn-beijing.aliyuncs.com
```

使用
--

[](#使用)

### 重新封装方法

[](#重新封装方法)

外网 url 上传文件

```
use AliyunOss;

#code
//自定义bucket
$bucket = '81f7-test';

//生成文件不带前缀
$file = AliyunOss::uploadFileByUrl('http://www.81f7.com/logo.png',$bucket);

//生成文件带 rc 前缀
$file = AliyunOss::uploadFileByUrl('http://www.81f7.com/logo.png',$bucket,'rc');
```

### 静态调用 Aliyun 自带方法

[](#静态调用-aliyun-自带方法)

```
use AliyunOss;

#code
//自定义bucket
$bucket = '81f7-test';
$file_name = 'logo.png';

//获取已有文件信息
$getFile = AliyunOss::getObjectMeta($bucket, $file_name);

//AliyunOss::getObjectMeta($bucket, $file_name);
//实际调用的是 `OSS/OssClient.php` 中的：
//public function getObjectMeta($bucket, $object, $options = NULL)
```

更多用法可以参考阿里云官方代码，[查看更多&gt;&gt;&gt;](https://github.com/aliyun/aliyun-oss-php-sdk/blob/master/src/OSS/OssClient.php)。

License
-------

[](#license)

除 “版权所有（C）阿里云计算有限公司” 的代码文件外，遵循 [MIT license](http://opensource.org/licenses/MIT) 开源。

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

Total

5

Last Release

2558d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a64653b1bb58634ac5b34fa0f5dc099acfda93bc5dedd5122f79f9a9727fa08?d=identicon)[chenhua](/maintainers/chenhua)

---

Top Contributors

[![ichenhua](https://avatars.githubusercontent.com/u/16658623?v=4)](https://github.com/ichenhua "ichenhua (7 commits)")

---

Tags

laravelaliyunosschenhua

### Embed Badge

![Health badge](/badges/chenhua-laravel5-aliyun-oss/health.svg)

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

###  Alternatives

[jacobcyl/ali-oss-storage

aliyun oss filesystem storage for laravel 5+

523566.2k7](/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)
