nova-menu-builder
nova-menu-builder copied to clipboard
getFields stores Image Field type as empty [] in the data field
When saving a custom Image field, the image gets stored as an empty array json instead of the uploaded file.
Ah yes, the Nova image field sucks quite a bit. I'm not too sure if we'll ever get it working with nova-menu-builder. For now, you could try any of the media libraries available that upload the image asynchronously (ie optimistdigital/nova-media-field).
@Tarpsvo Doing this will create an array with the media ID in the data attributes. How do you retrieve the actual url, path or filename? I can't find docs about this in optimistdigital/nova-media-field
The images are stored in a separate table. You can just query them using Media::find($mediaId)
or Media::findMany($mediaIds)
. When you get the media model, you can just gets its url like so: $media->url
.