Amalmax
10 months ago

Not working bootstrap navbar with <ul class=“nav nav-sidebar”> in Laravel 5.6

Posted 10 months ago by Amalmax

in my laravel application I have sidebar menu like following,

<ul class="nav navbar-nav">
      <li class="{{ active_menu(Route::CurrentRouteName(), 'welcome', 0,7)}}">
      <a href="{{route('welcome')}}">Home</a></li>

      <li class="{{ active_menu(Route::CurrentRouteName(), 'page1', 0,5)}}">
      <a href="{{route('page1')}}">Page 1</a></li>
      <li><a href="#">Page 2</a></li>
      <li><a href="#">Page 3</a></li>
    </ul>

this is working with Helper.php file in app/Helper/Helper.php3

<?php

if(! function_exists('active_menu')) {
    function active_menu($currentRouteName, $requestName, $start, $finish){
        if (substr($currentRouteName,$start, $finish) == $requestName){
            return 'active';

        }else{
            return null;
        }
    }
    }

this is working fine, but now I need change above sidemenu bar class as following,

<ul class="nav nav-sidebar">

only this change but now it is not working. how can I fix this problem?

Please sign in or create an account to participate in this conversation.