PHPackages                             abcsun/qiniu-laravel - 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. abcsun/qiniu-laravel

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

abcsun/qiniu-laravel
====================

Qiniu Resource (Cloud) Storage SDK for Laravel 5

150PHP

Since Apr 7Pushed 10y ago1 watchersCompare

[ Source](https://github.com/abcsun/qiniu-laravel-storage)[ Packagist](https://packagist.org/packages/abcsun/qiniu-laravel)[ RSS](/packages/abcsun-qiniu-laravel/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Qiniu 云储存 Laravel 5 Storage版
============================

[](#qiniu-云储存-laravel-5-storage版)

基于  开发

符合Laravel 5 的Storage用法。

安装
--

[](#安装)

- `composer require zgldh/qiniu-laravel-storage`
- `config/app.php` 里面的 `providers` 数组， 加上一行 `zgldh\QiniuStorage\QiniuFilesystemServiceProvider`
- `config/filesystem.php` 里面的 `disks`数组加上：

```
    'disks' => [
        ... ,
        'qiniu' => [
            'driver' => 'qiniu',
            'domain' => 'xxxxx.com1.z0.glb.clouddn.com',   //你的七牛域名
            'access_key'    => '',                          //AccessKey
            'secret_key' => '',                             //SecretKey
            'bucket' => '',                                 //Bucket名字
            'pipeline' => '',                               //pipeline名字
            'notify_url' => '',                             //持久化处理回调地址
        ],
    ],

```

- 完成

使用
--

[](#使用)

第一种用法

```
    $disk = \Storage::disk('qiniu');
    $disk->exists('file.jpg');                      //文件是否存在
    $disk->get('file.jpg');                         //获取文件内容
    $disk->put('file.jpg',$contents);               //上传文件
    $disk->prepend('file.log', 'Prepended Text');   //附加内容到文件开头
    $disk->append('file.log', 'Appended Text');     //附加内容到文件结尾
    $disk->delete('file.jpg');                      //删除文件
    $disk->delete(['file1.jpg', 'file2.jpg']);
    $disk->copy('old/file1.jpg', 'new/file1.jpg');  //复制文件到新的路径
    $disk->move('old/file1.jpg', 'new/file1.jpg');  //移动文件到新的路径
    $size = $disk->size('file1.jpg');               //取得文件大小
    $time = $disk->lastModified('file1.jpg');       //取得最近修改时间 (UNIX)
    $files = $disk->files($directory);              //取得目录下所有文件
    $files = $disk->allFiles($directory);               //这个没实现。。。
    $directories = $disk->directories($directory);      //这个也没实现。。。
    $directories = $disk->allDirectories($directory);   //这个也没实现。。。
    $disk->makeDirectory($directory);               //这个其实没有任何作用
    $disk->deleteDirectory($directory);             //删除目录，包括目录下所有子文件子目录

    $disk->getDriver()->uploadToken('file.jpg');            //获取上传Token
    $disk->getDriver()->downloadUrl('file.jpg');            //获取下载地址
    $disk->getDriver()->privateDownloadUrl('file.jpg');     //获取私有bucket下载地址
    $disk->getDriver()->imageInfo('file.jpg');              //获取图片信息
    $disk->getDriver()->imageExif('file.jpg');              //获取图片EXIF信息
    $disk->getDriver()->imagePreviewUrl('file.jpg','imageView2/0/w/100/h/200');              //获取图片预览URL
    $disk->getDriver()->persistentFop('file.flv','avthumb/m3u8/segtime/40/vcodec/libx264/s/320x240');   //执行持久化数据处理
    $disk->getDriver()->persistentStatus($persistent_fop_id);          //查看持久化数据处理的状态。
```

第二种用法 （就是省略了一个getDriver）

```
    use zgldh\QiniuStorage\QiniuStorage;

    $disk = QiniuStorage::disk('qiniu');
    $disk->exists('file.jpg');                      //文件是否存在
    $disk->get('file.jpg');                         //获取文件内容
    $disk->put('file.jpg',$contents);               //上传文件
    $disk->prepend('file.log', 'Prepended Text');   //附加内容到文件开头
    $disk->append('file.log', 'Appended Text');     //附加内容到文件结尾
    $disk->delete('file.jpg');                      //删除文件
    $disk->delete(['file1.jpg', 'file2.jpg']);
    $disk->copy('old/file1.jpg', 'new/file1.jpg');  //复制文件到新的路径
    $disk->move('old/file1.jpg', 'new/file1.jpg');  //移动文件到新的路径
    $size = $disk->size('file1.jpg');               //取得文件大小
    $time = $disk->lastModified('file1.jpg');       //取得最近修改时间 (UNIX)
    $files = $disk->files($directory);              //取得目录下所有文件
    $files = $disk->allFiles($directory);               //这个没实现。。。
    $directories = $disk->directories($directory);      //这个也没实现。。。
    $directories = $disk->allDirectories($directory);   //这个也没实现。。。
    $disk->makeDirectory($directory);               //这个其实没有任何作用
    $disk->deleteDirectory($directory);             //删除目录，包括目录下所有子文件子目录

    $disk->uploadToken('file.jpg');            //获取上传Token
    $disk->downloadUrl('file.jpg');            //获取下载地址
    $disk->privateDownloadUrl('file.jpg');     //获取私有bucket下载地址
    $disk->imageInfo('file.jpg');              //获取图片信息
    $disk->imageExif('file.jpg');              //获取图片EXIF信息
    $disk->imagePreviewUrl('file.jpg','imageView2/0/w/100/h/200');              //获取图片预览URL
    $disk->persistentFop('file.flv','avthumb/m3u8/segtime/40/vcodec/libx264/s/320x240');   //执行持久化数据处理
    $disk->persistentStatus($persistent_fop_id);          //查看持久化数据处理的状态。
```

官方SDK / 手册
----------

[](#官方sdk--手册)

-
-

说明
--

[](#说明)

在原有基础上增加了对PIPE以及回调地址参数的配置

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/41250730b73e5a266aa51d26064c9923ce114705be20ff10c4797358af45fc67?d=identicon)[abcsun](/maintainers/abcsun)

---

Top Contributors

[![longbai](https://avatars.githubusercontent.com/u/1204301?v=4)](https://github.com/longbai "longbai (86 commits)")[![rwifeng](https://avatars.githubusercontent.com/u/1814146?v=4)](https://github.com/rwifeng "rwifeng (72 commits)")[![xushiwei](https://avatars.githubusercontent.com/u/396972?v=4)](https://github.com/xushiwei "xushiwei (67 commits)")[![dtynn](https://avatars.githubusercontent.com/u/1426666?v=4)](https://github.com/dtynn "dtynn (37 commits)")[![longshanksmo](https://avatars.githubusercontent.com/u/2968746?v=4)](https://github.com/longshanksmo "longshanksmo (17 commits)")[![zgldh](https://avatars.githubusercontent.com/u/312404?v=4)](https://github.com/zgldh "zgldh (12 commits)")[![abcsun](https://avatars.githubusercontent.com/u/1784061?v=4)](https://github.com/abcsun "abcsun (5 commits)")[![callmez](https://avatars.githubusercontent.com/u/1625891?v=4)](https://github.com/callmez "callmez (3 commits)")[![5-say](https://avatars.githubusercontent.com/u/6258835?v=4)](https://github.com/5-say "5-say (2 commits)")[![peichao01](https://avatars.githubusercontent.com/u/844740?v=4)](https://github.com/peichao01 "peichao01 (2 commits)")[![hantuo](https://avatars.githubusercontent.com/u/873728?v=4)](https://github.com/hantuo "hantuo (2 commits)")[![BluntBlade](https://avatars.githubusercontent.com/u/1274124?v=4)](https://github.com/BluntBlade "BluntBlade (1 commits)")[![helloEson](https://avatars.githubusercontent.com/u/4487220?v=4)](https://github.com/helloEson "helloEson (1 commits)")[![xuzhaokui](https://avatars.githubusercontent.com/u/962469?v=4)](https://github.com/xuzhaokui "xuzhaokui (1 commits)")

### Embed Badge

![Health badge](/badges/abcsun-qiniu-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/abcsun-qiniu-laravel/health.svg)](https://phpackages.com/packages/abcsun-qiniu-laravel)
```

PHPackages © 2026

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