PHPackages                             huojunhao/tencent-oss-adapter - 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. huojunhao/tencent-oss-adapter

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

huojunhao/tencent-oss-adapter
=============================

Use Tencent oss as Storage for Laravel 5.0+

v0.0.1(7y ago)1281MITPHPPHP &gt;=5.4.0

Since May 22Pushed 7y ago1 watchersCompare

[ Source](https://github.com/huo376230434/tencent-oss-adapter)[ Packagist](https://packagist.org/packages/huojunhao/tencent-oss-adapter)[ Docs](https://github.com/huo376230434)[ RSS](/packages/huojunhao-tencent-oss-adapter/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (1)

&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD

Use tencent-oss-adapter as Laravel Storage
==========================================

[](#use-tencent-oss-adapter-as-laravel-storage)

模仿 [aliyun-oss-adapter](https://github.com/aobozhang/aliyun-oss-adapter)阿里云的oss包写了腾讯云的oss

### 腾讯云的OSS sdk: [qcloud/cos-sdk-v5](https://github.com/tencentyun/cos-php-sdk-v5)

[](#腾讯云的oss-sdk-qcloudcos-sdk-v5)

Usage
-----

[](#usage)

```
use Storage;

//...

## Installation

This package can be installed through Composer.
```bash
composer require aobozhang/aliyun-oss-adapter
```

Configuration
-------------

[](#configuration)

This service provider must be registered.

```
// config/app.php

'providers' => [
    ...,
        Huojunhao\OSS\TencentyunOssFilesystemServiceProvider::class
];
```

add config:

```
// config/filesystem.php.

        'tencent_oss' => [
            'driver'     => 'tencent_oss',
            'credentials'=>[
                'appId' => env('QCLOUD_APPID'),//开发者访问 COS 服务时拥有的用户维度唯一资源标识，用以标识资源
                'secretId'    => env('QCLOUD_SECRETID'),//开发者拥有的项目身份识别 ID，用以身份认证
                'secretKey' => env('QCLOUD_SECRETKEY')//开发者拥有的项目身份密钥
            ],
            'region' => env('QCLOUD_REGION'),//地区
            'bucket' => env('QCLOUD_BUCKET'),//COS 中用于存储数据的容器
        ],
```

change default to oss

```
'default' => 'tencent_oss';
```

\###demo

// 添加

```
 Storage::put('marss.jpg', file_get_contents(__DIR__."/mars.jpg"));

```

// 下载

```
 $contents = Storage::get('marss.jpg');
 file_put_contents(__DIR__ . "/testtencent.jpg", $contents);

```

// 是否存在

```
  $exists   = Storage::exists('marss.jpg');
          dump($exists);

```

// 大小(单位为B)

```
    $size     = Storage::size('marss.jpg');
            dump($size);

```

// 最新更新时间

```
    $time     = Storage::lastModified('marss.jpg');
    dump(date("Y-m-d H:i:s",$time));

```

// 复制

```
    Storage::copy('test/marss.jpg', 'new/marss.jpg');

```

// 移动

```
     Storage::move('marss.jpg', 'new/test/marss.jpg');

```

目前只实现了这几个功能，其他的比如列表显示等还没有实现

=======

tencent-oss-adapter
===================

[](#tencent-oss-adapter)

> > > > > > > 8b1ba242542d3641becbe6cea5e9cbefb78cde4e

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

2912d ago

### Community

Maintainers

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

---

Top Contributors

[![huo376230434](https://avatars.githubusercontent.com/u/19550875?v=4)](https://github.com/huo376230434 "huo376230434 (5 commits)")

---

Tags

laravelstorageosstencent

### Embed Badge

![Health badge](/badges/huojunhao-tencent-oss-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/huojunhao-tencent-oss-adapter/health.svg)](https://phpackages.com/packages/huojunhao-tencent-oss-adapter)
```

###  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)
