FinnT730
FinnT730
Explore posts from servers
FFilament
Created by FinnT730 on 5/19/2025 in #❓┊help
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
FileUpload::make('image')
->disk('public')
->directory('article_images')
->visibility('public')
->acceptedFileTypes(['image/*'])
->preserveFilenames()
->image()
->imageEditor()
->getUploadedFileNameForStorageUsing(
fn (\Illuminate\Http\UploadedFile $file): string => (string) str_replace(' ', '', $file->getClientOriginalName())
)
->columnSpanFull(),
FileUpload::make('image')
->disk('public')
->directory('article_images')
->visibility('public')
->acceptedFileTypes(['image/*'])
->preserveFilenames()
->image()
->imageEditor()
->getUploadedFileNameForStorageUsing(
fn (\Illuminate\Http\UploadedFile $file): string => (string) str_replace(' ', '', $file->getClientOriginalName())
)
->columnSpanFull(),
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!
6 replies