plank / laravel-mediable

Laravel-Mediable is a package for easily uploading and attaching media files to models with Laravel
MIT License
758 stars 100 forks source link

add url attribute getter #327

Closed abbasudo closed 6 months ago

abbasudo commented 1 year ago

hello! thanks for your powerful package. This PR will add a URL attribute getter. Personally, i need this attribute because I am developing restful api apps and should retrieve the full url to the client on each call.

thanks again for your greate work

frasmage commented 1 year ago

Can you explain how $media->url makes any significant improvement over $media->getUrl(), aside from being syntactic sugar?

abbasudo commented 1 year ago

@frasmage attribute getter gives the ability to load and append url on relation calls.

Post::media()->get()->append('url');