Issue with $this->form->getState() for Previewing Resume
When I use $this->form->getRawState();, everything works fine except I can't get the file upload URL. But if I switch to $this->form->getState(), I can get the URL, but it also validates every form field, which I don't want. How can I fix this so I can get the file upload URL without having to validate every form field? Any help would be awesome!
I have a similar issue as described in this question: https://www.answeroverflow.com/m/1152352566525566996
I have a similar issue as described in this question: https://www.answeroverflow.com/m/1152352566525566996
Using
getRawState()
returns an array for FileUpload - FilamentI use
getRawState()
in order to display previews within my blade view, but the only problem is that while getState()
returns the correct string and URL for a $logo value/state, using getRawState()
doesn't and causes issues. How would I fix this?11 Replies
Is the file upload a TemporaryUploadedFile?
No @Leandro Ferreira
I mean, in the
$this->form->getRawState()
its return this object when i upload image if i am using
$this->form->getRawState()
and 2nd screenshot its already saved in database then return this value. I tried array_values($data['profile_photo']); when already saved in databaseSorry, I didn't understand what is the issue..
ok sorry @Leandro Ferreira did you read this https://www.answeroverflow.com/m/1152352566525566996 I have similar issue
Using
getRawState()
returns an array for FileUpload - FilamentI use
getRawState()
in order to display previews within my blade view, but the only problem is that while getState()
returns the correct string and URL for a $logo value/state, using getRawState()
doesn't and causes issues. How would I fix this?getState()
will validate the form and process the uploads 🤷♂️which one is good for preview data with fileupload
$this->form->getRawState()
or $this->form->getState()
Is it possible to get the
TemporaryUploadedFile
image path?getPath()
, getRealPath()
.. something like this@Leandro Ferreira thanks its
$state->getRealPath()