set nav link active on the basis of route laravel
<li class="{{ (request()->is('admin/cities*')) ? 'active' : '' }}">
set nav link active on the basis of route laravel
<li class="{{ (request()->is('admin/cities*')) ? 'active' : '' }}">
active link
# Foward slash is equal to homepage. For all others you use IN keyword.
<li
{% if '/' == request.path %}
class="nav-item active mr-3"
{% else %}
class="nav-item mr-3"
{% endif %}
>
<li
{% if 'about' in request.path %}
class="nav-item active mr-3"
{% else %}
class="nav-item mr-3"
{% endif %}
>
laravel assign active based on route name
<li class = "{{ set_active('admin/users') }}">
<a href="{{ url('/admin/users/') }}">Users</a>
</li>
laravel assign active based on route name
function set_active( $route ) {
if( is_array( $route ) ){
return in_array(Request::path(), $route) ? 'active' : '';
}
return Request::path() == $route ? 'active' : '';
}
active link
#top-menu .current a
{
color: orange !important;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us