title: Access Auth::user() in route.php
body: <p>I'm having a problem in accessing the Auth::user() in my route.php. So far here's what i've got:</p>
  
  <pre><code>Route::group(['middleware' =&gt; 'auth'], function () {
      if(Auth::user()-&gt;role == "manager"){
          Route::get('/','ManagerController@index');
      }
      else if(Auth::user()-&gt;role == "rater"){
          Route::get('/','RaterController@index');
      }
  });
  </code></pre>
  
  <p>It gives me this error "Trying to get property of non-object" whenever I try to use the Auth::user()->role</p>