Amalmax
199
6
Laravel

Why did not Laravel 5.6 active menu item highlight using request?

Posted 7 months ago by Amalmax

Hi, working with laravel 5.6 and develop sidemenu bar with bootstarp. I am using request to highlight current menu items here. but it is not highlight when it is in current menu.

<li class="{{ Request::is('products*') ? 'active' : '' }}">

    <a href="{!! route('products.index') !!}"><span>Products</span></a>

</li>


<li class="{{ Request::is('tags*') ? 'active' : '' }}">

    <a href="{!! route('tags.index') !!}"><span>Tags</span></a>

</li>


<li class="{{ Request::is('items*') ? 'active' : '' }}">

    <a href="{!! route('items.index') !!}"><span>Items</span></a>

</li>

how can I fix this problem?

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

Reply to

Use Markdown with GitHub-flavored code blocks.