title: Sidebar menu hide from users using laravel
body: <p>I am a beginner at laravel and I have Hidden sidebar menu from users it's successfully working but when logout from admin then I face error how to fix it thanks. please see error <a href="https://flareapp.io/share/NPL9bz7w" rel="nofollow noreferrer">https://flareapp.io/share/NPL9bz7w</a></p>
  
  <p><strong>Html view</strong></p>
  
  <pre><code>             &lt;!-- Sidebar Menu --&gt;
               &lt;nav class="mt-2"&gt;
               &lt;ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" 
                role="menu" data-accordion="false"&gt;
               &lt;!-- Add icons to the links using the .nav-icon class
               with font-awesome or any other icon font library --&gt;   
               &lt;!--Admin sidebar menu --&gt;
               @if(Auth::user()-&gt;type  == "admin")
               &lt;li class="nav-item"&gt;
              &lt;a href="{{url('admin')}}" class="nav-link"&gt;
              &lt;i class="fas fa-comments"&gt;&lt;/i&gt;
              &lt;p&gt;Users Permission&lt;/p&gt;
              &lt;/a&gt;
              &lt;/li&gt;
              &lt;li class="nav-item"&gt;
              &lt;a href="{{url('manage_users')}}" class="nav-link"&gt;
              &lt;i class="fas fa-comments"&gt;&lt;/i&gt;
               &lt;p&gt;Manage Users&lt;/p&gt;
              &lt;/a&gt;
             &lt;/li&gt;
            &lt;li class="nav-item"&gt;
            &lt;a href="{{url('register')}}" class="nav-link"&gt;
             &lt;i class="fas fa-comments"&gt;&lt;/i&gt;
             &lt;p&gt; User Register&lt;/p&gt;
             &lt;/a&gt;
             &lt;/li&gt;
             &lt;!-- end Admin sidebar menu --&gt;
             &lt;!--   User sidebar menu --&gt;
             @else
            &lt;li class="nav-item"&gt;
            &lt;a href="{{url('viewprofile')}}" class="nav-link"&gt;
            &lt;i class="fas fa-user"&gt;  &lt;/i&gt;
            &lt;p&gt;View Profile&lt;/p&gt;
            &lt;/a&gt;
            &lt;/li&gt;
            &lt;li class="nav-item"&gt;
            &lt;a href="{{url('DashBoard')}}" class="nav-link"&gt;
             &lt;i class="fas fa-comments"&gt;&lt;/i&gt;
             &lt;p&gt;Chat Room&lt;/p&gt;
             &lt;/a&gt;
            &lt;/li&gt;
  
            @endif
  
  
  
  
      &lt;/ul&gt;
    &lt;/nav&gt;
    &lt;!-- /.sidebar-menu --&gt;
  </code></pre>