2017 © Pedro Peláez
 

library laupload

一个 laravel 上传小组件

image

guanguans/laupload

一个 laravel 上传小组件

  • Wednesday, June 27, 2018
  • by guanguans
  • Repository
  • 0 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Version License PHP version GitHub tag , (*1)

一个 laravel 的上传组件

安装

``` sh composer global require fxp/composer-asset-plugin composer require guanguans/laupload, (*2)


## 使用 ### 注册服务 `config/app.php` 中: ``` php 'providers' => [ ... guanguans\laupload\LauploadServiceProvider::class, ],

或者 app/Providers/AppServiceProvider.php 中:, (*3)

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


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

配置

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


### 视图 ``` html <div class="col-md-4"> <!----------文件视图-----------> {!! laupload_widget('file') !!} <!----------单图视图-----------> {!! laupload_widget('oneImage') !!} <!----------多图视图-----------> {!! laupload_widget('muiImage') !!} <!----------移动端视图---------> {!! laupload_widget('app') !!} </div>

后台

``` php 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()]; }, (*6)

return $data;

} ```, (*7)

License

MIT, (*8)

The Versions

27/06 2018

dev-master

9999999-dev https://github.com/guanguans/laupload

一个 laravel 上传小组件

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • npm-asset/hdjs 1.2.105

 

by Avatar guanguans

laravel upload laupload

27/06 2018

v1.2.0

1.2.0.0 https://github.com/guanguans/laupload

一个 laravel 上传小组件

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • npm-asset/hdjs 1.2.105

 

by Avatar guanguans

laravel upload laupload

26/06 2018

v1.1.0

1.1.0.0 https://github.com/guanguans/laupload

一个 laravel 上传小组件

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • npm-asset/hdjs 1.2.105

 

by Avatar guanguans

laravel upload laupload

26/06 2018

v1.0.0

1.0.0.0 https://github.com/guanguans/laupload

一个 laravel 上传小组件

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • npm-asset/hdjs 1.2.105

 

by Avatar guanguans

laravel upload laupload