function active_menu($url) { return $url == request()->path() ? 'active' : ''; } laravel code example
Example: laravel sidebar menu active
{{ request()->routeIs('news.*') ? 'active' : '' }}
{{ request()->routeIs('news.*') ? 'active' : '' }}