Spatie Media Column #557
-
Trying to use the new integration with Spatie Media Library and have run into this issue. When trying to show the column in the list like so
Nothing happens, I'm thinking it's because there is no field in the model called banner. When using Spatie Media Library the database doesn't have column names on the model, so I'm not sure how I can access this. I have also tried
Not sure how to proceed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
As an update to this. I added the field to my edit, and after that the media DOES show. So it appears to only work with files that have been uploaded using the If you have existing associated media it will not show or if you associate the media outside of the CRUD. I'm not sure if this is intentional, but I think it should show any media. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the suggestions. I will try to reproduce the issues you mentioned but I guess it's because previous media does not have the custom properties required to work with uploaders. We need to save some additional information in the custom properties of the media, and we use that information for display/saving purposes. I don't think we can do something about it (in the current implementation), just probably document how to do it and developer could run a database query to update their media accordingly to the fields where it's used. Maybe expose a different API in case there is no "custom properties" set by CRUD, you could set them in the column/field to work with media saved outside crud/previous media. https://github.com/Laravel-Backpack/medialibrary-uploaders#custom-properties If you are not using it inside repeatable the only custom attribute you need to set in the media custom properties is the Do you have any suggestion regarding this ? Cheers |
Beta Was this translation helpful? Give feedback.
Thanks for the suggestions.
I will try to reproduce the issues you mentioned but I guess it's because previous media does not have the custom properties required to work with uploaders.
We need to save some additional information in the custom properties of the media, and we use that information for display/saving purposes.
I don't think we can do something about it (in the current implementation), just probably document how to do it and developer could run a database query to update their media accordingly to the fields where it's used.
Maybe expose a different API in case there is no "custom properties" set by CRUD, you could set them in the column/field to work with media saved outside…