Создание маршрутов для контроллера ресурсов работает следующим образом:
Route::resource(
'/resource',
'ResourceController',
$options
);
где /resource
– строка, определяющая точку входа (url) и ResourceController
– это имя требуемого контроллера ресурсов.
Массив $options
– это ассоциативный массив, содержащий любой из следующих элементов:
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 |
Эти параметры взяты из исходный код.