Hello! When im saving my formData - FileUpload gives string like this "icons/01HXW41XREQJ420D95GMW"
Hello! When im saving my formData - FileUpload gives string like this "icons/01HXW41XREQJ420D95GMW", and when i trying to fill form im recieving this error:
foreach() argument must be of type array|object, string given. How i can fix that?
8 Replies
Cast your column as an array. I think it should also save as array.
$data = $this->form->getState();
dd($data);
this returned data of form
Which one is the FileUpload?
android-icon
What happens when you cast it as an array? Doesn’t that work?
That works now after cast to array. It turns out that you need to cast into an array when saving?
Solution
You should have an
array
cast on the column for your modelOK, thank you so much!