PHPackages                             liucg1995/laravel-uploader - 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. liucg1995/laravel-uploader

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

liucg1995/laravel-uploader
==========================

A upload component for laravel

1.0.2(5y ago)014MITJavaScriptPHP &gt;=5.5.9

Since Dec 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/liucg1995/laravel_uploader)[ Packagist](https://packagist.org/packages/liucg1995/laravel-uploader)[ RSS](/packages/liucg1995-laravel-uploader/feed)WikiDiscussions master Synced today

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

Laravel Uploader
================

[](#laravel-uploader)

`Laravel`下的一个上传组件, 支持直传到第三方云存储。

安装
--

[](#安装)

```
composer require Liucg1995/laravel-uploader
```

添加服务提供者
-------

[](#添加服务提供者)

```
Liucg1995\Uploader\UploaderServiceProvider::class,
```

生成资源文件
------

[](#生成资源文件)

```
php artisan vendor:publish --provider=Liucg1995\\LaravelUploader\\UploadServiceProvider
php artusan migrate
```

设置文件储存方式
--------

[](#设置文件储存方式)

config/webuploader.php

```
[
    'disk'=>'public',
]
```

使用
--

[](#使用)

1. 添加上传组件到页面

    单文件上传

    ```
      {!! form_upload_attach('file','file',$item) !!}
    ```

    多文件上传

    ```
      {!! form_upload_attaches('file','file','id') !!}
    ```

    > 该组件依赖`jQuery`，所以在引入的资源文件的时候必须先引入`jQuery`
2. 保存附件内容到数据库

    单文件上传

    ```
    Model::create(['file'=>$request->file , 'file_id'=>$request->file_id]);
    ```

    多文件上传

    ```
     UploadMulti::save_multi_info($request->file, $news->id, 'news');
    ```

直传到云存储
------

[](#直传到云存储)

该组件支持直传到第三方云存储，实际上就是模拟了表单上传的方式。从流程上来说相比于传统的先上传到服务器，再从服务器传到云存储来说，少了一步转发。从架构上来说，原来的上传都统一走网站服务器，上传量过大时，瓶颈在网站服务器，可能需要扩容网站服务器。采用表单上传后，上传都是直接从客户端发送到云存储。上传量过大时，压力都在云存储上，由云存储来保障服务质量。

目前支持的第三方云储存： `本地(local)` `百度云(bos)` `腾讯云(cos)` `阿里云(oss)` `七牛云(qiniu)` `新浪云(scs)` `又拍云(upyun)`

> 其中的本地不算云存储，只是标识仍旧支持本地磁盘存储。

### 1.配置

[](#1配置)

百度云：

```
'disks' => [
    'bos' => [
        'driver'       => 'bos',
        'access_key_id'    =>  'xxxxxxxxxx',
        'access_key_secret'   => 'xxxxxxxxxx',
        'bucket'       => 'xxx',
        'region'    =>  'gz'    //改成存储桶相应地域
    ],
]
```

腾讯云：

```
'cos' => [
        'driver'       => 'cos',
        'app_id'    =>  '123456789',
        'secret_id'   => 'xxxxxxxxxxx',
        'secret_key'   => 'xxxxxxxxxxx',
        'bucket'       => 'xxxxxxxxx',
        'region'    =>  'sh'    //改成存储桶相应地域
    ]
```

> 注意，腾讯云存储的时候不是以资源的访问路径存的，会加上appid和存储桶的参数。主要是腾讯云上传后没有返回资源的相对路径，而且这样的存储方式也是官方推崇的。

阿里云：

```
'oss' => [
        'driver'       => 'oss',
        'access_key'   => 'xxxxxxxxxx',
        'secret_key'   => 'xxxxxxxxxx',
        'bucket'       => 'xxxxx',
    ],
```

```
composer require "iidestiny/laravel-filesystem-oss"
```

七牛云：

```
'qiniu' => [
        'driver'     => 'qiniu',
        'access_key' => 'xxxxxxxxxxxxxxxxxx',
        'secret_key' => 'xxxxxxxxxxxxxxxxxx',
        'bucket'     => 'xxxxxxxxxxxxxxxxxx',
        'domain'     => 'xxxxxxxxxxx'
    ],
```

```
composer require "zgldh/qiniu-laravel-storage"
```

### 2.设置云储存

[](#2设置云储存)

config/webuploader.php

```
[
    'disk'=>'qiniu',
]
```

License
-------

[](#license)

MIT

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Total

3

Last Release

2020d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33537868?v=4)[l-guo](/maintainers/l-guo)[@l-guo](https://github.com/l-guo)

---

Top Contributors

[![liucg1995](https://avatars.githubusercontent.com/u/23516497?v=4)](https://github.com/liucg1995 "liucg1995 (26 commits)")

### Embed Badge

![Health badge](/badges/liucg1995-laravel-uploader/health.svg)

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

###  Alternatives

[zgldh/qiniu-laravel-storage

Qiniu Resource (Cloud) Storage SDK for Laravel 5/6/7/8/9

515401.1k14](/packages/zgldh-qiniu-laravel-storage)[overtrue/flysystem-qiniu

Flysystem adapter for the Qiniu storage.

231925.9k67](/packages/overtrue-flysystem-qiniu)[yangyifan/upload

上传 SDK for Laravel

12122.7k3](/packages/yangyifan-upload)[itbdw/laravel-storage-qiniu

A storage library for laravel5 and qiniu sdk

7515.3k](/packages/itbdw-laravel-storage-qiniu)[catlane/chunk-file-upload

文件上传小扩展，可支持大文件分块分片上传到七牛云or本地，优化您上传大文件的苦恼

284.9k](/packages/catlane-chunk-file-upload)

PHPackages © 2026

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