Answers for "set active menu laravel"

PHP
4

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' : '' }}">
Posted by: Guest on May-01-2021
0

nav active in laravel

//  check using route name
<li class="{{ request()->routeIs('city/create') ? 'active' : '' }}"
Posted by: Guest on October-02-2021

Browse Popular Code Answers by Language