Download the PHP package jhonoryza/laravel-fileupload-component without Composer
On this page you can find all versions of the php package jhonoryza/laravel-fileupload-component. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jhonoryza/laravel-fileupload-component
More information about jhonoryza/laravel-fileupload-component
Files in jhonoryza/laravel-fileupload-component
Package laravel-fileupload-component
Short Description file upload component
License MIT
Informations about the package laravel-fileupload-component
Laravel File Upload Component
laravel livewire file upload component
Requirement
- php v8.2
- laravel v10
- livewire v3
- spatie/media-library v10
Installation
Quick Start
prepare model, example Setting model
prepare livewire form class
in create or edit livewire component
in view livewire component
Property Explanation
- name is required and will affect what the event name is
- :model you need to pass a variable with Model type that implement HasMedia
- collection is for media collection name
- :multiple for single file upload or multiple file upload
- :canUploadFile to hide file selector
Component Event
this component dispatch 2 event when temporary upload is started
- media:temporary-upload-started
- media:temporary-upload-finished
change media
with the name
property, example name
property is images
or you can listen to default livewire file upload event like this
another 2 event when the file is removed / loaded or added
- media:onFileReplace
- media:onFileAdded
change media
with the name
property, example name
property is images
next thing todo
- [ ] test validation with error message
- [ ] add unit test
- [x] bug when interacts with session flash after redirect (session flash data is missing)
Security
If you've found a bug regarding security please mail [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.