title: Access a controller function on Auth::user();
body: <p>I used the scaffolding tools to generate my authentication code for my laravel project. I created a UserController to make a profile page which works great but when I try to make a function that can be used on Auth::user() i get an error <code>Call to undefined method Illuminate\Database\Query\Builder::admin()</code></p>
  
  <p>Why isn't the admin function accessible on the Auth::user()? Doesn't that extend my UserController? Or am I mixing it up with the model? Is the the model a good place to check if my user is an admin?</p>
  
  <p>Here is my user controller</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use Auth;
  use App\Http\Requests;
  
  class UserController extends Controller
  {
  
      /**
       * Create a new user controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('auth');
      }
  
      /**
       * @return View with user data
       */
      public function index() {
          $user = Auth::user();
  
          return view('users.index', compact('user'));
      }
  
      /**
       * @return bool
       * Returns bool if the user is an admin.
       */
      public function admin() {
          $user = Auth::user();
  
          $authorized_users = [
              'admin@test.com'
          ];
  
          return array_key_exists($user-&gt;email, $authorized_users);
      }
  }
  </code></pre>
  
  <p>and I am calling it on a different route controller function</p>
  
  <pre><code>public function index() {
      return Auth::user()-&gt;admin();
  }
  </code></pre>
  
  <p>I am fairly new to laravel and php so any critique is valuable and wanted!</p>