How to dehydrate FileUpload?
Dehydration is the process which gets data from fields, and transforms it. It runs when you call the form's getState() method.However, when using
$this->form->getState()
it triggers the validation that affects the whole form. How to bypass the Form validation (and just validate the current state only) and just get the state value of the file?
11 Replies
$livewire->validateOnly('file')
?I need the state value. The one that makes the file be uploaded in the storage folder ( not just in
livewire-tmp
) and returns the string of file path . The form->getState()
did that. Now I'm looking for a method that does that without using form->getState()
.what about getRawState()?
->getRawState()
still returns that Livewire/TemporaryUploadFile and the file is not uploaded .?
That worked, any idea on how to get the file name? I got
null
$component->getState() ?
When using
$component->getState()
I got this:
All I need is ["learning_docs/1/sample2.pdf"]
without UUID. Do I just need to do it manually by using a foreach
?Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Cool, it worked!
nice 👌