title: If Condition in Laravel Routes File
body: <p>Is there a way to have if statements in the routes.php file in Laravel 5? I have tried this but does not work:</p>
  
  <pre><code>Route::get('/', function()
   {
     if ( Auth::user() )
       Route::get('/', 'PagesController@logged_in_index');
     else
       Route::get('/', 'PagesController@guest_index');
     endif
   });
  </code></pre>
  
  <p>I would prefer this way could work. Thanks.</p>