PHPackages                             wubuze/upload-file - 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. wubuze/upload-file

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

wubuze/upload-file
==================

upload file for PHP laravel

018PHP

Since Jan 28Pushed 7y agoCompare

[ Source](https://github.com/gnwai/uploadFile)[ Packagist](https://packagist.org/packages/wubuze/upload-file)[ RSS](/packages/wubuze-upload-file/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel 上传文件
============

[](#laravel-上传文件)

安装
--

[](#安装)

- composer require wubuze/upload-file

- app\\config\\app.php 文件中provider 加上, laravel5.5 以上可以忽略

- Wubuze\\UploadFile\\UfffServiceProvider::class,
- php artisan vendor:publish , 选择 wubuze-file-config

- 生成的storage.php 文件里面可以配置文件上传路径
- php artisan storage:link

迁移数据库,创建model
-------------

[](#迁移数据库创建model)

- php artisan migrate 生成表 file、file\_group

- 创建 App\\Model\\File 必须继承 UploadFile\\Model\\File\\File

- 创建 App\\Model\\FileGroup 继承 UploadFile\\Model\\File\\FileGroup

上传文件
----

[](#上传文件)

- use UploadFile\\File\\Uploader;
- $module = config('storage.'.$req-&gt;input('module')); if (!$module) { return 'error'; }
- Uploader::init($req-&gt;file('file'));
- $file = Uploader::upload($module\['dir'\], $req-&gt;input('fileName'), $module\['public'\]);
- $file-&gt;setUrl();
- return @\[ 'id' =&gt; $file-&gt;id, 'url' =&gt; $file-&gt;url, 'top' =&gt; $file-&gt;top, 'name' =&gt; $file-&gt;file.'.'.$file-&gt;type, \];

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/aad7e78084a5393c95d03e0ab67423928d808962299c613f5c519dfcdcd9cfca?d=identicon)[wubuze](/maintainers/wubuze)

---

Top Contributors

[![wubuze](https://avatars.githubusercontent.com/u/22925125?v=4)](https://github.com/wubuze "wubuze (13 commits)")

### Embed Badge

![Health badge](/badges/wubuze-upload-file/health.svg)

```
[![Health](https://phpackages.com/badges/wubuze-upload-file/health.svg)](https://phpackages.com/packages/wubuze-upload-file)
```

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