nova-medialibrary-field
nova-medialibrary-field copied to clipboard
Add `->defaultCollection()`
Hi,
The issue is that on the frontend blade, ->getMediaUrl() does not work unless a collection name is provided.
This is because Spatie uses default as collection name if one is not specified. However, this package will use 'name' from ::make('name'), and I understand why.
My suggestion is to add ->defaultCollection() to prevent this package from using 'name'. This will then allow getMedialUrl() to work like described in medialibrary's docs.
I prefer not to write ::make('name', 'default') because it is less readable and can cause confusion for those who are new to medialibrary and we can document the purpose of defaultCollection() since it is a function.
Thank you.
@bilogic Good point. I'll add that method.