ViralTiger of Viralbamboo Application Developers
9/28/2017 - 10:38 AM

Watson Routing Active Helper

Active is a helper package for Laravel that makes it easy to recognize the current path or route, useful for adding 'active' classes (like those used in the Boostrap framework) and performing other actions only when a certain route is active. It also includes helpers for retrieving the current controller and action names.

https://github.com/dwightwatson/active

// Ensure route.name matches route passed to active() function.
<a href="{{ route('route.name') }}" class="{{ active('route.name','active-class') }}">All posts</a>