title: Customizing auth middleware - Laravel 5
body: <p>The delivered <code>auth</code> middleware that comes with Laravel 5 is great for user-only routes and controllers, however I want to add the ability to also check if the user is an administrator.</p>
  
  <p>Currently, in my controllers, I have this for every class:</p>
  
  <pre><code>if (Auth::user()-&gt;level &lt;= 1) {
      // admin can do these actions
  } else {
      // redirect
  }
  </code></pre>
  
  <p>It's very redundant and I'd like to look at what my options are. Since I want to retain the original <code>auth</code> middleware for user authentication, should I be building a new one for administrator authentication, or can I make some simple change in the original <code>auth</code> middleware that can account for my code above?</p>