Download the PHP package tapp/blade-uppy without Composer
On this page you can find all versions of the php package tapp/blade-uppy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tapp/blade-uppy
More information about tapp/blade-uppy
Files in tapp/blade-uppy
Package blade-uppy
Short Description Uppy Blade components for Laravel
License MIT
Homepage https://github.com/TappNetwork/blade-uppy
Informations about the package blade-uppy
Uppy blade
This package adds Blade components for Uppy to use in your Laravel Blade views.
Installation
Install the package via Composer
Add required JS libraries
Add in your package.json
file the AlpineJS library and all the Uppy libraries you need (or install them directly according to the Uppy site doc):
Add the Uppy libraries in your resources/js/bootstrap.js
file:
Add in your resources/js/app.js
:
Install the JS libraries:
using Mix:
using Vite:
Publish config file (optional)
Publish the config file with:
The published config file contains the Uppy events that are loaded as components:
Publish view files (optional)
Usage
Uppy uploaders are available as Blade components:
- AWS S3
<x-input.uppy.s3>
- AWS S3 Multipart
<x-input.uppy.s3-multipart>
- XHR
<x-input.uppy.xhr>
- Tus
<x-input.uppy.tus>
- Transloadit
<x-input.uppy.transloadit>
This is the component skeleton (using the s3
blade component as an example, but it's the same for s3-multipart
, xhr
, tus
, and transloadit
):
The UI that should be used (dashboard
or drag-drop
) can be defined with the ui
attribute and UI options with uiOptions
attribute:
Any plugin can be added using the plugins
array attribute, where the key is the plugin name and the value is the plugin options:
Add any event using the events
array attribute, where the key is the event name and the value is the event code:
If you need to add extra JS code, use the extraJs
attribute:
Uploaders
S3
Add the input.uppy.s3
blade component to your blade view:
S3 Multipart
Add the input.uppy.s3-multipart
blade component to your blade view.
E.g. using the Dashboard UI:
XHR
Add the input.uppy.xhr
blade component to your blade view.
E.g. using the Drag and Drop UI:
Tus
Add the input.uppy.tus
blade component to your blade view:
Transloadit
Add the input.uppy.transloadit
blade component to your blade view:
Available attributes for each component:
Attribute | Description | Default value |
---|---|---|
instanceName | Uppy instance name | uppyUpload |
coreOptions | Core Uppy instance options | {} |
uploaderOptions | Options used by uploader | {} |
ui | UI for upload (dashboard or drag-drop) | dashboard |
uiOptions | Options that should be passed to the UI | {} |
:events | PHP array with the Uppy events (keys are event names, values are event code) | [] |
:plugins | PHP array with the Uppy plugins (keys are plugin name, values are plugin options) | [] |
extraJs | Extra JS code | '' |
Uppy instance name
Use the instanceName
attribute to define the Uppy instance name.
Default: uppyUpload
Core Options
Core Uppy options are defined with the coreOptions
attribute.
Default:
Uploader Options
Can be defined using uploaderOptions
attribute.
Default:
User Interface
ui attribute
Define the User Interface (UI) that should be used (Dashboard or Drag&Drop). Possible values:
- dashboard
- drag-drop
E.g.:
Default: dashboard
uiOptions attribute
You may pass the Uppy UI JS options via uiOptions
attribute.
E.g.:
Default: {}
Docs:
Dashboard example:
Drag & Drop example:
Plugins
User Interface Elements
UI elements can be added using the plugins
attribute associative array, where the key should be the same name as the UI element (E.g. the key for Status Bar
element is StatusBar
) and the value is the JS options to be passed to the UI element.
UI elements Plugins:
- StatusBar
- ProgressBar
- DropTarget
- Informer
- ImageEditor
- ThumbnailGenerator
E.g.:
Sources
Define the sources to be used for upload using the plugins
associative array attribute.
Source Plugins:
- Webcam
- Audio
- ScreenCapture
E.g.:
Misc
Another misc plugins can be added using the component's plugins
associative array attribute.
Misc Plugins:
- Golden Retriever
- Compressor
- Locales
- Form
For example to use the GoldenRetriever
(uppy.use(GoldenRetriever, { serviceWorker: false })
) and Compressor
(uppy.use(Compressor, { quality: 0.6 })
) plugins:
Events
Define the events as a PHP associative array (key is the event name and value is the JS content of the event) passed to events
attribute:
Adding extra JS code
You can add some extra JS code using extraJs
attribute.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
If you discover any security-related issues, please email [email protected].
Credits
- Tapp Network
- All Contributors
Libraries used in this package:
License
The MIT License (MIT). Please see License File for more information.