title: Laravel 4 routing to controller method
body: <p>I'm currently trying to route as follows:</p>
  
  <ul>
  <li>If user GETs <code>/account/</code> 
  <ul>
  <li>If session has <code>account_id</code>, user is logged in; show his account information</li>
  <li>If not, user is not logged in; show login/create form</li>
  </ul></li>
  <li>If user POSTs <code>/account/</code>
  <ul>
  <li>If input has <code>create</code>, user wants to create account; create it</li>
  <li>If not, user wants to login; find his account and go again to <code>/account/</code></li>
  </ul></li>
  </ul>
  
  <p>My routes are set this way:</p>
  
  <pre><code>Route::get('account', function() {
      if (Session::has('account_id'))
          return 'AccountsController@show';
      else
          return 'AccountsController@index';
  });
  
  Route::post('account', function() {
      if (Input::has('create')) {
          return 'AccountsController@create';
      else    
          return 'AccountsController@login';
  )};
  </code></pre>
  
  <p>This is somewhat how I would do with Rails, but I don't know how to point to the controller method. I just get the returned string as a result. I didn't find it in Laravel documentation (which I found really poor, or have I searched wrong?) neither in any other web tutorial.</p>