Download the PHP package fsuuaas/laravel-plupload without Composer
On this page you can find all versions of the php package fsuuaas/laravel-plupload. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-plupload
Laravel 12 Plupload
Laravel package for Plupload http://plupload.com.
This package uses some parts of https://github.com/jildertmiedema/laravel-plupload
Requirements
- PHP 8.2 or higher
- Laravel 12.0 or higher
Installation
Require this package with composer:
The package will automatically register its service provider and facade.
Publish the package configuration:
Usage
Uploading files
1. Use default plupload html
Use the examples found on the plupload site. The Getting Started page is good place to start.
2. Plupload builder
make($id, $url)
Create new uploader.
- $id: the unique identification for the uploader.
- $url: the upload url end point.
or use the helper
render($view = 'plupload::uploader', array $data = [])
Renders the uploader. You can customize this by passing a view name and it's data.
3. Use package js file to initialize Plupload (Optional)
If you do not want to write your own js to initialize Plupload, you can use the upload.js
file that included with the package in resources/views/vendor/plupload/assets/js
. Make sure that you already have jQuery
loaded on your page.
Initialize Plupload
These following methods are useable with the upload.js
file.
Set Uploader options
setOptions(array $options)
Set uploader options. Please visit https://github.com/moxiecode/plupload/wiki/Options to see all the options. You can set the default global options in config/plupload.php
Automatically start upload when files added
Use setAutoStart()
in your builder before calling render() function.
setAutoStart($bool)
- $bool:
true
orfalse
Receiving files
file($name, $handler)
- $name: the input name.
- $handler: callback handler.
Use this in your route or your controller. Feel free to modify to suit your needs.
Helper is also available
If you are using the package upload.js
file. The url
and deleteUrl
in the JSON payload will be used to generate preview and delete link while the id
will be appended to the uploader as a hidden field with the following format:
<input type="hidden" name="{uploaderId}_files[]" value="{id}" />
.
Please note that the deleteUrl
uses DELETE
method.