Tworzenie tras dla kontrolera zasobów działa w następujący sposób: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.
Tablica $options
jest tablicą asocjacyjną zawierającą dowolne z następujących opcji:
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 |
Te opcje pochodzą z kodu źródłowego.