Upload field saves as a array after saving 2 times without changing anything
So when when saving the first time, it stores it correctly, like
article_images/20250428_123231.jpg
however, when I save it again, without changing anything about the resource, it gets stored like {"effa7623-0b08-4e64-9c1a-0449cb63e866":"article_images\/20250428_123231.jpg"}
the code I have for the file uploader is
I have a custom saving function created as well, however, I can't share this becuase of work policy (and this is still generic enough for it to be fine)
is there a known reason why it is being turned into a array after saving it when nothing is changed? Maybe I am doing something wrong? I could not find a lot about this issue.
Thanks in advance!Solution:Jump to solution
Update on this, it seems that the boss man was able to figure it out.
Thanks for the help!!...
3 Replies
Not by default, if you haven't enabled multiple then it shouldn't? But multiple does need model casting to array
https://filamentphp.com/docs/3.x/forms/fields/file-upload#uploading-multiple-files
I do not have a multiple upload.
it might be the custom saving I am doing though...
I will come back on that
Solution
Update on this, it seems that the boss man was able to figure it out.
Thanks for the help!!