htmlcsslaravelvoyager

How to add custom classes to Laravel Voyager menu items


I have main menu in Voyager which has some items in it (navbar buttons). I output all of the items in my blade view with

{{menu('main', 'bootstrap')}}

Problem is that all of the items (navbar buttons) have the same look to them. I have custom classes for them in my style.css file but I could not find a way to style all the items differently. Database menu does not provide a menu_items table where I could add my own classes either.


Solution

  • I figured out that you have to use {{menu('main', '_json')}} and afterwards you iterate each of the items in a foreach loop and do whatever you want with them.