PHPackages                             jiahm/uploadfile - 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. jiahm/uploadfile

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

jiahm/uploadfile
================

一个通用laravel上传组件

00PHP

Since Apr 3Pushed 6y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

一个 laravel 的上传组件
================

[](#一个-laravel-的上传组件)

[![StyleCI](https://camo.githubusercontent.com/65e8e55f56a26503040774843430578c793f96aa6e2afec15563d64eb77989bd/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3133383135323331382f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/138152318)[![Latest Stable Version](https://camo.githubusercontent.com/6658971bf9f68f778b6a7992b3189d8be4fe15bede5016a8f0610d68797e2e50/68747470733a2f2f706f7365722e707567782e6f72672f6775616e6775616e732f6c6175706c6f61642f762f737461626c65)](https://packagist.org/packages/guanguans/laupload)[![Version](https://camo.githubusercontent.com/9fb356f88e7a687bd810800d315df62ac8f162b7ffeb2b8d6c97a6c7f47bb9d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6775616e6775616e732f6c6175706c6f61642e737667)](https://packagist.org/packages/guanguans/laupload)[![License](https://camo.githubusercontent.com/1746c5bb5546ff9d3bfdcf228fbc9512f5127a496b78b3163ea2530671725109/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6775616e6775616e732f6c6175706c6f61642e737667)](https://packagist.org/packages/guanguans/laupload)

[![](./docs/demo.gif)](./docs/demo.gif)

安装
--

[](#安装)

```
$ composer global require fxp/composer-asset-plugin
$ composer require guanguans/laupload
```

使用
--

[](#使用)

### 注册服务

[](#注册服务)

`config/app.php` 中：

```
'providers' => [
    ...
    guanguans\laupload\LauploadServiceProvider::class,
],
```

或者 `app/Providers/AppServiceProvider.php` 中：

```
...
public function register()
{
    $this->app->register('guanguans\laupload\LauploadServiceProvider');
}
```

```
$ php artisan vendor:publish --provider="guanguans\laupload\LauploadServiceProvider"
```

### 配置

[](#配置)

```
return [
    ...
    'uploadStore'  => 'uploadStore', // 上传文件路由
    'uploadFileList' => 'uploadFileList', // 获取文件列表路由
];
```

### 视图

[](#视图)

```

    {!! laupload_widget('file') !!}

    {!! laupload_widget('oneImage') !!}

    {!! laupload_widget('muiImage') !!}

    {!! laupload_widget('app') !!}

```

### 后台

[](#后台)

```
use guanguans\laupload\Laupload;
...
public function store()
{
    $upload = new Laupload();
    $upload->savePath = storage_path('app/public/laupload') . '/'; // 上传根目录
    if ($upload->upload()) {
        // 成功时返回数据 message 为文件地址
        $data = ['valid' => 1, 'message' => asset('storage/app/public/laupload/'.$upload->getUploadFileInfo()[0]['savename'])];
    } else {
        // 失败时返回数据 message 为失败原因
        $data = ['valid' => 0, 'message' => "后台提示:" . $upload->getErrorMsg()];
    }

    return $data;
}
```

License
-------

[](#license)

[MIT](./LICENSE)

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 95.1% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9dcc072e5c9cd01de726c9e1162ed7f30fa59b82d64f53e2df51d9c3bbee5d8f?d=identicon)[jiahm](/maintainers/jiahm)

---

Top Contributors

[![guanguans](https://avatars.githubusercontent.com/u/22309277?v=4)](https://github.com/guanguans "guanguans (39 commits)")[![jiahm](https://avatars.githubusercontent.com/u/15919687?v=4)](https://github.com/jiahm "jiahm (2 commits)")

### Embed Badge

![Health badge](/badges/jiahm-uploadfile/health.svg)

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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