Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Really useful tool that you can use is the <code>artisan</code> CLI.</p> <p>Using this you'll be able to generate the needed function file with all the required routes for it to become RESTful. </p> <pre><code>php artisan controller:make users </code></pre> <p>Would generate the function file for you. Then in your routes.php file you can simply add </p> <pre><code>Route::resource('users', 'Users'); </code></pre> <p>This'll setup all the necessary routes. </p> <p>For more information on this you should read the documentation at.</p> <p><a href="http://four.laravel.com/docs/routing#resource-controllers" rel="nofollow noreferrer">http://four.laravel.com/docs/routing#resource-controllers</a></p> <p><a href="http://four.laravel.com/docs/artisan" rel="nofollow noreferrer">http://four.laravel.com/docs/artisan</a> </p> <p><strong>Edit:</strong></p> <p>To make this admin specific, simple alter the code like follows and move the controller to a admin folder inside the controllers folder.</p> <pre><code>Route::resource('admin/users', 'admin.Users'); </code></pre> <p>The first paramater is the route, the second is the controller filename/folder. </p> <p>In Laravel if you placed a controller inside a folder, to specific it in a route or URL you'd use the a dot for folders. </p> <p>You can then expand on this and add Authentication using Route Filters and specifically the code found "Pattern Based Filters" found on the page below. </p> <p><a href="http://four.laravel.com/docs/routing#route-filters" rel="nofollow noreferrer">http://four.laravel.com/docs/routing#route-filters</a></p>
 

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