FileUpload in Livewire Component
Hi! I've got a strange problem : i'm trying to use a livewire component with HasForms in frontend. My form is simple : 2 textInput and one FileUpload.
On submit the form send textinput values with no problem. But the FileUpload is always "null".
I'm testing this on my local env "localhost:8000"
What can I try to resolve that?
20 Replies
seems like the file is not uploaded yet when I hit submit button
but in my forms, the FileUpload component looks like a classical html input type="file" field. Not the Filepond field
Did you add
$this->form->fill()
in the mount method?
Are you using a statePath()
in the form?
console errors?Hi @Leandro Ferreira ! thank you for helping me.
Yes, $this->form->fill() is set in the mount method. statePath('data') is set too
I just find this error in console :
in .env :
APP_URL=http://127.0.0.1:8000
not sure if is related, but u did php artisan storage:link?
Hi @ericmp ! yes i do
if u do storage:unlink and link it again it still happens?
nope, sorry that doesn't work
if u remove the last
/
it still happens?not working neither
probably I miss something cause when I push my code on a remote host, the FileUpload component is still not working :
* no /storage 404 error ( that's cool !)
* but the FilePond element is not loaded : the FileUpload input is still just a normal html input file
Do you know if FilePond works in a livewire component?
I think you have a setup issue if it is showing like this
Did you follow this section?
https://filamentphp.com/docs/3.x/forms/installation#existing-laravel-projects
I think so, but may be I screwed something up. I'll start a new project from scratch
thanks all for your help
just curious, were u running the app via php artisan serve? or herd or? @mattiagsis
running from php artisan serve
alright @Leandro Ferreira it works on a fresh install 🙂
i probably made a setup error previously : install panel, then tried to make frontend component works
with a fresh install : voilà ! 🌟
you are awesome all!
Thank you for taking the time to help me.
🦾