When a resource controller is created in Laravel like this:
Route::resource('foo', 'FooController');
We get URLs like:
- foo/create
- foo/store
- foo/{id}/edit
- foo/{id}/update
- ...
I would like to translate some of these routes to get something like:
- foo/nouveau
- foo/store
- foo/{id}/modifier
- foo/{id}/update
This code is working:
Route::resource('foo', 'FooController', array(
'names' => array(
'create' => 'nouveau',
'edit' => 'modifier',
...
)
));
The problem here is the edit
route: I don't know how to make it works with an {id}
like foo/{id}/modifier
.