Handling active menu item in Laravel 5
Put this in your helper file:
1 2 3 4 5 6 |
Usage:
1 2 3 |
Multi-level:
1 2 3 4 5 6 7 8 9 10 11 12 13 | <li class="{{ set_active(['admin/items', Request::is('admin/auction/*'), 'admin/something']) }}"> <ul> <li class = "{{ set_active('admin/item') }}"> <a href="{{ url('/admin/item') }}">All</a> </li> <li class = "{{ set_active('admin/item/create') }}"> <a href="{{ URL::to('/admin/item/create') }}">Add New</a> </li> <li class = "{{ set_active('admin/something') }}"> <a href="{{ URL::to('/admin/something') }}">Something</a> </li> </ul> </li> |
Do you need help with a project? or have a new project in mind that you need help with?
Contact Me