Trying to have FileUpload works with my table
->How can I have fileupload to work with my DB structure ? Actually my images table is a polymorph table
I have my component like that
->directory seems to doesn't work too. If I Put the image at the root of my disk, the image is displayed; but not if my image is in image/resource/1/1/4/114/
What do I need to change the saving process and use my own column ?
5 Replies
->directory seems to doesn't work too
->directory()
just sets where to store the file. It still stores the whole filepath from the root of the disk in the database. You could try ->getStateUsing()
to add the directory as a prefixI'm in a form builder and I don't find where to use getStateUsing ?
Wait, sorry. I think that only works for table columns
I think it's either:
- Updating the DB to include the directory
- Mutating the state of the FileUpload field through
mutateFormDataBeforeFill()
on the EditPageThanks for you help, i'm using mutateFormDataBeforeFill
Now how can I change/overide upload and delete action ?
Delete Action probably doesn't need adjustment as it just removes an item from an array?
I think upload can changed via
saveUploadedFilesUsing()
or similar method