[5.2] Get current route name in Blade templates
Hi all,
This seems to be a simple question but I can't figure out how to do it.
I need to know what is the current route name in a Blade template to be able to do something like:
@if ($currentRoute == 'homepage')
...
@endif
Im using Laravel 5.2
Can someone help me on this?
Thanks in advance!
You can use the url() global function:
url()->current()
@SaeedPrez thanks for your reply. I forgot to tell that Im using Laravel 5.2 :(
@zachleigh Thanks for your answer. That's the URI. I need the route name.
That's not even valid blade syntax
Please or to participate in this conversation.