Upload Files Using Filepond in Livewire Components
- Published on 01 August, 2024
- Words: 132
Filepond is a JavaScript package that allows you to upload anything, with popular integrations for React, Vue, Svelte, and more
If you're using Livewire, now you can easily use Filepond to upload files within Livewire components using Spatie's livewire-filepond package. This package contains a Livewire component that allows you to start using it in your Laravel projects easily:
use LivewireComponent;
use SpatieLivewireFilepondWithFilePond;
class MyLivewireComponent extends Component
{
use WithFilePond;
public $file;
}
// <x-filepond::upload wire:model="file" />
You can pass any property that Filepond accepts, and you can further customize the Livewire Filepond component with the following options available at the time of writing:
- Allow multiple file uploads
- Make the file upload required
- Ability to disable the upload input
- Custom placeholder text
You can learn more about this package, get full installation instructions, and view the source code on GitHub. To learn more about this project, check out Freek Van der Herten's writeup about this package.
Antonio Jenaro
Web Developer
Source: Laravel news
Start the conversation
Become a member of Antonio Jenaro to start commenting.
Sign up nowAlready a member? Sign in