LaravelMetaTags icon indicating copy to clipboard operation
LaravelMetaTags copied to clipboard

Get Tag's attributes as a property

Open glenncoppens opened this issue 2 years ago • 1 comments

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

glenncoppens avatar Sep 07 '23 09:09 glenncoppens

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();

butschster avatar Sep 10 '23 19:09 butschster