Quickstart: Use Filepond in a Livewire component
mainTo implement Filepond, follow these three steps:
- Add scripts: Include the
@filepondScriptsdirective in your layout or view. - Add the trait: Use the
WithFilePondtrait in your Livewire component. - Add the component: Use the
<x-filepond::upload />Blade component and bind it to a public property usingwire:model.
use Livewire\Component;
use Spatie\LivewireFilepond\WithFilePond;
class MyLivewireComponent extends Component
{
use WithFilePond;
public $file;
}@filepondScripts
<x-filepond::upload wire:model="file" />