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
Matthieu Bé ( il/he)
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
LeandroFerreira
LeandroFerreira6mo ago
Did you add $this->form->fill() in the mount method? Are you using a statePath() in the form? console errors?
Matthieu Bé ( il/he)
Hi @Leandro Ferreira ! thank you for helping me. Yes, $this->form->fill() is set in the mount method. statePath('data') is set too
Matthieu Bé ( il/he)
I just find this error in console :
No description
Matthieu Bé ( il/he)
in .env : APP_URL=http://127.0.0.1:8000
ericmp
ericmp6mo ago
not sure if is related, but u did php artisan storage:link?
Matthieu Bé ( il/he)
Hi @ericmp ! yes i do
ericmp
ericmp6mo ago
if u do storage:unlink and link it again it still happens?
Matthieu Bé ( il/he)
nope, sorry that doesn't work
ericmp
ericmp6mo ago
if u remove the last / it still happens?
Matthieu Bé ( il/he)
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?
LeandroFerreira
LeandroFerreira6mo ago
I think you have a setup issue if it is showing like this
No description
Matthieu Bé ( il/he)
I think so, but may be I screwed something up. I'll start a new project from scratch thanks all for your help
ericmp
ericmp6mo ago
just curious, were u running the app via php artisan serve? or herd or? @mattiagsis
Matthieu Bé ( il/he)
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à ! 🌟
Matthieu Bé ( il/he)
you are awesome all! Thank you for taking the time to help me.
ericmp
ericmp6mo ago
🦾
Want results from more Discord servers?
Add your server