Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In a RESTful controller, the method names are prefixed with the HTTP verb they should respond to, so a if you assign the TaskController to the URI tasks like so:</p> <pre><code>Route::controller('tasks', 'TaskController'); </code></pre> <p>and do a GET request to <code>/tasks/info</code> that would call the <code>TaskController@getInfo</code> method. See <a href="http://four.laravel.com/docs/controllers#restful-controllers" rel="noreferrer">http://four.laravel.com/docs/controllers#restful-controllers</a> for more details.</p> <p>In a resourceful controller, there are predefined methods available which match to automatic routes that are created. You can assign a resourceful controller to a route like so:</p> <pre><code>Route::resource('lists', 'ListController'); </code></pre> <p>This then allows you to do a GET request to <code>/lists/1</code> for example which should show the list with an ID of 1 and calls the <code>ListController@show</code> method. A full list is available here: <a href="http://four.laravel.com/docs/controllers#resource-controllers" rel="noreferrer">http://four.laravel.com/docs/controllers#resource-controllers</a>.</p> <p>To answer the first question, no all controllers are not RESTful by default unless you assign them using <code>Route::controller()</code>. A normal controller is used by assigning routes to controller methods manually like so:</p> <pre><code>Route::get('about', 'HomeController@about'); </code></pre> <p>or for a named route:</p> <pre><code>Route::get('about', array( 'as' =&gt; 'about', 'uses' =&gt; 'HomeController@about' )); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload