Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel active menu item

// check using uri
<li class="{{ request()->is('sites/*/edit') ? 'active' : '' }}"
 // or, check using route name
<li class="{{ request()->routeIs('sites/*/edit') ? 'active' : '' }}"
  // or, using segment
<li class="{{ (request()->segment(2) == 'cities') ? 'active' : '' }}"> 
 
PREVIOUS NEXT
Tagged: #laravel #active #menu #item
ADD COMMENT
Topic
Name
7+6 =