Hi, howcan you create a menu in laravel?
Because It would be bad if I copy&pasted the menu on every page.
My idea was to make the menu in a seperate file that I include in my master Layout. This way I have the menu just once. Thus, I can edit it easier.
But this way I can't highlight the current page in the menu (e.g. a class="active" at the menu point that is active).
Do you have any ideas? Thank you :)
Well you should be able to highlight it, you could do something like this in your partial
<li class="{{( Request::segment('1') == 'something' ? 'active' : false )}}"><a href="{{ url('something')}}">Something</a></li>
Or you could write your own class where you can check if it's active and whatnot, but for simple menus I believe it's ok to do just like my example
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community