Laravel active menu item for url included parameters

前端 未结 10 2463
暖寄归人
暖寄归人 2020-12-28 14:43

I\'m trying to set active class in my list item, but it doesn\'t work.

My code in blade:

@foreach($data as $site)
  
10条回答
  •  醉话见心
    2020-12-28 15:25

    I like more to use this syntax to check the route since has not been mentioned.

  • Teams
  • Two more things:

    • Adding an asterisk, without a dot as route name will target all the routes that start with team, teams, etc.

    • If you are using any CSS framework like Bootstrap or Tailwind you can add here also the classes to style the menu item, instead of writing some CSS for it.

提交回复
热议问题