Level 58
You can use Livewire's wire:model directive to bind the FilePond component to a Livewire property. This will allow you to access the uploaded files in your Livewire component.
First, you'll need to install the FilePond package:
composer require pqina/laravel-filepond
Then, you can add the FilePond component to your Livewire view:
<div>
<input type="file" wire:model="files" />
<livewire:filepond name="files" />
</div>
In your Livewire component, you can access the uploaded files using the files property:
public $files;
public function save()
{
// Access the uploaded files here
foreach ($this->files as $file) {
// ...
}
}
2 likes