title: Laravel 4 defining RESTful controllers
body: <p>So I'm new to the Laravel framework as of v4 and wondering what is the way to create and use RESTful controllers. Reading through the documentation, I'm a bit confused as to the difference between RESTful controllers and Resource controllers.</p>
  
  <p>When defining a RESTful controller, as per the docs, it suggests doing the following in <code>routes.php</code>:</p>
  
  <pre><code>Route::controller('posts', 'PostController');
  </code></pre>
  
  <p>In the <code>PostController</code>, do we define the class methods by prefixing the name of the method with the HTTP verb we should like to use? For example:</p>
  
  <pre><code>class PostController extends \BaseController {
      public function getIndex()
      {
          //
      }
  }
  </code></pre>
  
  <p>However, it also outlines a way of creating Resource controllers in the <code>routes.php</code> file like so:
      Route::resource('posts', 'PostController');</p>
  
  <p>And in <code>PostController.php</code> we define methods without prefixing it with the HTTP verb.</p>
  
  <pre><code>class PostController extends \BaseController {
      public function index()
      {
          //
      }
  }
  </code></pre>
  
  <p>What is the difference between the two? And when do we use one instead of the other, and why?</p>
  
  <p>Also, should we use <code>Route::controller('posts', 'PostController');</code> or <code>Route::resource('posts', 'PostController');</code> to pass routing to the controller or should we define each route manually, like below:</p>
  
  <pre><code>Route::get('/users', 'UserController@index');
  Route::get('/users/create', 'UserController@create');
  Route::post('/users', 'UserController@store');
  Route::get('/users/{id}', 'UserController@show');
  Route::get('/users{id}/edit', 'UserController@edit');
  Route::put('/users', 'UserController@update');
  Route::delete('/users', 'UserController@destroy');
  </code></pre>