Framework: Route only or except.

Created on 23 May 2017  路  1Comment  路  Source: laravel/framework

  • Laravel Version: 5.4.X

This topic for feature request.

When you use Route::resource('/test', 'TestController');. You will got.

| Domain | Method    | URI                                      | Name           | Action                                            | Middleware   |
+--------+-----------+------------------------------------------+----------------+---------------------------------------------------+--------------+
|        | POST      | api/test                                 | test.store     | App\Http\Controllers\TestController@store         | api          |
|        | GET|HEAD  | api/test                                 | test.index     | App\Http\Controllers\TestController@index         | api          |
|        | GET|HEAD  | api/test/create                          | test.create    | App\Http\Controllers\TestController@create        | api          |
|        | GET|HEAD  | api/test/{test}                          | test.show      | App\Http\Controllers\TestController@show          | api          |
|        | PUT|PATCH | api/test/{test}                          | test.update    | App\Http\Controllers\TestController@update        | api          |
|        | DELETE    | api/test/{test}                          | test.destroy   | App\Http\Controllers\TestController@destroy       | api          |
|        | GET|HEAD  | api/test/{test}/edit                     | test.edit      | App\Http\Controllers\TestController@edit          | api          |
+--------+-----------+------------------------------------------+----------------+---------------------------------------------------+--------------+

Some time you didn't use all of that.

If they have function like. Route::resource('/test', 'TestController')->only('store', 'index', 'show', 'update'); or Route::resource('/test', 'TestController')->except('destroy', 'create', 'edit');. I think it will be good.

Most helpful comment

It already has.

https://laravel.com/docs/5.4/controllers#resource-controllers
Partial Resource Routes

For feature request you can use internals repo, this is for bug tracking only.

>All comments

It already has.

https://laravel.com/docs/5.4/controllers#resource-controllers
Partial Resource Routes

For feature request you can use internals repo, this is for bug tracking only.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lzp819739483 picture lzp819739483  路  3Comments

digirew picture digirew  路  3Comments

Anahkiasen picture Anahkiasen  路  3Comments

felixsanz picture felixsanz  路  3Comments

gabriellimo picture gabriellimo  路  3Comments