Lazy file uploads

I have a form with multiple file upload fields. Since all files are immediately uploaded to Livewire TemporaryUploadedFiles, the form is locked in the meantime. Since some of my forms require to upload bigger files and the user has sometimes slow upload speed, this really breaks the workflow of the user, if they have to wait for 3-5 seconds after selecting each file. Long story short: Is there a way, to make file upload fields "lazy", so that they get uploaded only when the user clicks on save? There is a ->lazy() method, but this makes no difference?
1 Reply
toeknee
toeknee15mo ago
Not out of the box as far as I am ware, you would need to customise the field to remove the model:defer and then use alpine to handle it see: https://laravel-livewire.com/docs/2.x/file-uploads#js-api
Livewire
File Uploads | Livewire
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.