butschster / LaravelMetaTags

The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project
MIT License
547 stars 51 forks source link

Get Tag's attributes as a property #56

Open glenncoppens opened 1 year ago

glenncoppens commented 1 year ago

Is your feature request related to a problem? Please describe. Get the current value of a tags property. Eg, I wanted to get the current title that was set, as a string. But I had to do something like Meta::getTitle()->toArray()['content'] to get the string value.

Describe the solution you'd like Can we leverage PHP's magic methods on the base Tag to get the value of a tag's attribute as a property? Like Meta::getTitle()->content (I know title is a special implementation, so maybe not the best example though)

Describe alternatives you've considered See above

butschster commented 1 year ago

HI, @glenncoppens Could you try a new version https://github.com/butschster/LaravelMetaTags/releases/tag/v3.0-beta1 ? Here you can find additional methods like

Meta::getTitle()->getTitle();