No need for third party libs :) https://sinnbeck.dev/posts/making-a-complete-file-uploader-with-progressbar-using-livewire-and-alpinejs
Aug 29, 2022
29
Level 4
Filepond in livewire with alpine.js
I integrated filepond in my project, am getting a problem when I upload a file it doesn't show its progress from 1 % to 100% but other things work well and the image view also with no problem.
livewire/filepond.blade.js
<div class="row">
<div class="col-md-12">
<div
wire:ignore
x-data
x-init="
FilePond.registerPlugin(FilePondPluginImagePreview);
FilePond.setOptions({
AllowMultiple: 'multiple' ? 'true' : 'false',
server: {
process: (fieldName, file, metadata, load, error, progress, abort, transfer, options) => {
@this.upload('uploadedFiles', file, load, error, progress)
},
revert: (filename, load) => {
@this.removeUpload('uploadedFiles', filename, load)
},
},
});
FilePond.create($refs.input);
"
>
<label>File Upload</label>
<input type="file" x-ref="input" wire:mode="uploadedFiles" multiple>
</div>
</div>
</div>
I got all this from this video: https://laravel-livewire.com/screencasts/s5-integrating-with-filepond
Please or to participate in this conversation.