Creating routes for a resource controller works like:
Route::resource(
'/resource',
'ResourceController',
$options
);
where /resource
is the string defining the entry point (url) and ResourceController
is the name of the required resource controller.
The $options
array is an associative array containing any of:
option | type(s) | description |
---|---|---|
only |
array string dynamic |
Set the methods the controller should apply to |
except |
array string dynamic |
Set the methods the controller should exclude |
names |
array string |
Set the route names for controller actions |
names.method |
string |
Set the route name for a controller action |
parameters |
string array |
Override the route parameter names |
parameters.previous |
string |
Override a route parameter’s name |
middleware |
mixed |
Set a middleware to the resource |
These options were derived from the source code.