file upload error
Does anyone has an issue with FileUpload form field? FIle is uploading as saved, but when I try to edit record with FileUplaod field I get an error: foreach() argument must be of type array|object, string given
Laravel 11. Does anyone has a solution?
14 Replies
are you using
->multiple()
?No, I am using ->avatar
could you share the code?
what happens if you change
->disk('public')
?Same 😦
are you using the panel builder or only the form builder?
I assume $this->getState() return value from database, and not array. Good question. I am not very familiar with exact term, but I am building form in form method in UserResource.
Did you create a UserResource, right? And add the avatar column as a string column in the users table?
technically avatar is in profiles table column. But yes, avatar column is string
Is profile a relationship?
yes
try
I made similar with fieldset. Filename is saved to profiles table. The issue is I think, that when retrieving file it expects array, but state has path string