How to use Spatie Media Library in a json repeater field.
I have a requirement, where I need to use Spatie Media file upload and store the model_id in json column.
Here is the required structure:
Here is what i am trying, It can read files from Media model.
I am trying to find a way to set component when save form.
When i dd() the form data, the items array contains only key/value properties but not the model_id
3 Replies
Here is how i am implementing the repeater
I tried to tweak the
saveUploadedFileUsing
method to set state and return the model id but it did not work and the json array still has only key/value properties.
I know this might not be the best way to do it.
I am open to suggestion and or any better implementation/solution.Hello Mansoor,
Did you get this to work ?
@skram I was able to make it work but with some hacks that i would not recommend.