Best way to generate page titles?

Posted 1 year ago by Boubou


I would like to know what is the best way of generating page titles in Laravel please. I understand how to do it in pure PHP but with Laravel I am a bit lost.

For example, you have a main layout file, inside the layout file you have partials, if a partial shows content "XYZ" and that in this content I have already a field "title", how can I pass this $data->title that may come from multiple controllers to the main layout file, this is the part that confuses me.

I hope I explain it correctly:-)


Please sign in or create an account to participate in this conversation.