jeudi 19 avril 2018

(api) resource group route

When grouping routes through resources as such:

Route::resource('books/{book}/catalog', 'CatalogController', ['names' => [
    'index' => 'catalog.index',
    'store' => 'catalog.store',
    'update' => 'catalog.update',
    'destroy' => 'catalog.destroy',
], 'except' => ['create', 'edit', 'show']]);

The route:list command outputs:

DELETE    | api/v1/books/{book}/catalog/{catalog}
PUT|PATCH | api/v1/books/{book}/catalog/{catalog}

However I was hoping for:

DELETE    | api/v1/books/{book}/catalog
PUT|PATCH | api/v1/books/{book}/catalog

Any suggestions how I can get the results when grouping, without the extra {catalog} parameter in the DELETE and PUT|PATCH routes?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2vrLF8q
via IFTTT

Aucun commentaire:

Enregistrer un commentaire