title: What is the best way to display menu in Laravel 5.1?
body: <p>I would like to ask that which is the best way to show menu with access parameters.</p>
  
  <p>So, now I'm using the following code in my <code>default.blade.php</code>:</p>
  
  <pre><code>@if (Sentry::getUser()-&gt;hasAccess('something'))
      &lt;li class="{{ (Request::is('panda/something') ? 'open' : '') }}"&gt;
          &lt;a href="{{ URL::to('panda/flot_charts') }}" class="menu-dropdown"&gt;
               &lt;span class="menu-text"&gt;Menu 1&lt;/span&gt;&lt;i class="menu-expand"&gt;&lt;/i&gt;
          &lt;/a&gt;
          &lt;ul class="submenu"&gt;
          @if (Sentry::getUser()-&gt;hasAccess('school'))
              &lt;li class="{{ (Request::is('panda/school') ? "active" : '') }}"&gt;
                   &lt;a href="{{ route('school') }}"&gt;&lt;i class="menu-icon fa fa-cogs"&gt;&lt;/i&gt;&lt;span class="menu-text"&gt;Submenu&lt;/span&gt;&lt;/a&gt;
              &lt;/li&gt;
          @endif
          &lt;/ul&gt;
      &lt;/li&gt;
  @endif
  </code></pre>
  
  <p>It looks like:
  <a href="https://i.stack.imgur.com/iaQIK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iaQIK.png" alt="screenshot about left menu bar"></a></p>
  
  <p>I know that this solution is not really good. I'm looking for an easier and more simple way to show menu.</p>
  
  <p>I always have to check what page the visitor sees and the same menu has to be active.</p>
  
  <p>Now I'm using <a href="https://cartalyst.com/manual/sentry/2.1" rel="nofollow noreferrer">Sentry</a>, but I'd like to use <a href="http://laravel.com/docs/5.1/middleware" rel="nofollow noreferrer">middleware</a> in the future.</p>
  
  <p>Shall I store the menu parameters in <code>db</code>?</p>
  
  <p>Thanks for your help!</p>
  
  <p>Peter</p>