title: Laravel Roles and authentication to routes
body: <p>I am looking to archive the the following</p>
  
  <p>Userlogs in -> Assigned a privilege from the DB -> They can only see allowed routes only</p>
  
  <p>So far i have been able to reach here:</p>
  
  <pre><code>$user = Usercredential::where('username','=',Auth::user()-&gt;username)-&gt;get();
  
  foreach ($user as $u ) {
  
          $status = $u-&gt;userstatus;
          $userPriv = $u-&gt;userpriviledge;
  
          if ($status == 0){  
                             Session::put('user_priv',$userPriv);
              }
          else{
                      return Redirect::to_route('home')-&gt;with('message','Inactive users cannot login');
              }
  </code></pre>
  
  <p>Which checks the status of the user if active or inactive then stores the priviledge in my session. What next? How do i protect my routes? </p>
  
  <p>Thanks</p>