2017 © Pedro Peláez
 

library fileupload

image

virtualorz/fileupload

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

The README.md

Usage

Use for bootstap and Laravel project to upload file
Use Laravel storage to store upload files
This project require PHP imagick extension to save thumb and fit jpg file, (*1)

Install

composer require virtualorz/fileupload

Config

edit config/app.php, (*2)

'providers' => [
    ...
    Virtualorz\Fileupload\FileuploadServiceProvider::class
]

'aliases' => [
    ...
    'Fileupload' => Virtualorz\Fileupload\Facades\Fileupload::class,
]

Publish data

php artisan vendor:publish --provider="Virtualorz\Fileupload\FileuploadServiceProvider"

Edit .env

edit .env file add UPLOADDIR for dir name to save files under public dir
edit .env file add FILESYSTEM_DRIVER=public, (*3)

Edit config/filesystems.php

edit the 'disks' area, replace the 'public' to, (*4)

'public' => [
            'driver' => 'local',
            'root' => public_path('uploads'),
            'url' => env('APP_URL').'uploads',
            'visibility' => 'public',
        ],

Usage

In view:

And need an file element like :
<input type="file" name="file" id="file" class="file_input" accept=".jpeg" multiple data-size="240*240" data-is_image="true">
accept attribute can edit to the file type you want
multiple attribute can let you upload multiple files
data-size is to check image size
data-is_image set upload is image or not


And after file element call {!! Fileupload::createUploadArea('UPLOAD_COLUMN_NAME',$files)!!}
UPLOAD_COLUMN_NAME can edit to the column name you need

In controller
use $request->get('upload_file') to get upload files array

Method

createUploadArea($column_name = '','$files = null)

return bload html for view to generate file upload html area, in edit mode you can put the uploed file to $files variable, (*5)

createUploadResult($files = null)

return bload html for view to generate file upload Result html area, use in detail page you can put the uploed file to $files variable, (*6)

中文版本文件

Fileupload : 快速產生檔案上傳介面及管理, (*7)

The Versions

06/06 2018

dev-master

9999999-dev

  Sources   Download

by Avatar virtualorz

06/06 2018

1.0.2

1.0.2.0

  Sources   Download

by Avatar virtualorz

05/06 2018

1.0.1

1.0.1.0

  Sources   Download

by Avatar virtualorz

24/05 2018

1.0.0

1.0.0.0

  Sources   Download

by Avatar virtualorz