artesaos / seotools

SEO Tools for Laravel
MIT License
3.07k stars 503 forks source link

Get title in view? #102

Closed ghost closed 5 years ago

ghost commented 6 years ago

I'm loving this seotools for Laravel and have a quick question about how I should go about calling the title from a view?

In my controller I'm using SEO::setTitle('About Me'); to set the title of the page for the SEO, however in my view I have a "Page Title" block that I would like to dynamically show the title of the pages using the SEO::setTitle function. I know I can pass a title var through the view with return view('pages.about-me')->with(compact('pageTitle'); but is there another way to get the seo title without passing it in?

stefkes commented 6 years ago

Have you tried SEOMeta::getTitle(); ?