laravel blade directive render current menu item active

This is how you might use a laravel blade directive to render current menu item as active in your blade template without using inline php code directly.
The trick is to get it to render the template at render time NOT compile time so it updates to the current nav item and doesn’t cache.
\htdocs\app\Providers\BladeFormatServiceProvider.php

And in your blade template you call it like this:

That’s it.
laravel blade directive render current menu item active
Fullstack4u.com shares web development tips for full stack web technologies and is helping share the passion to web developers worldwide.

Leave a Reply

Your email address will not be published. Required fields are marked *