You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know we can use $item->media to get all media for a selected item, but I prefer the same output as getMedia(). As it turns out, you can run getMedia('') and pass an empty $collectionName as argument. This will load all media with loadMedia() and supports empty strings.
This seems to be expected / intended behaviour. I didn't expect this to be honest. I know it's hard to predict the future but can I expect this to stay like this or did I wake a sleeping dog?
Thanks for all the hard work by the way. It's very much appreciated!
The text was updated successfully, but these errors were encountered:
I know we can use $item->media to get all media for a selected item, but I prefer the same output as getMedia(). As it turns out, you can run
getMedia('')
and pass an empty$collectionName
as argument. This will load all media withloadMedia()
and supports empty strings.https://github.com/spatie/laravel-medialibrary/blob/9fa2989f826da065d098f6f865cc7ad755c35d33/src/HasMedia/HasMediaTrait.php#L505-#L521
This seems to be expected / intended behaviour. I didn't expect this to be honest. I know it's hard to predict the future but can I expect this to stay like this or did I wake a sleeping dog?
Thanks for all the hard work by the way. It's very much appreciated!
The text was updated successfully, but these errors were encountered: