vendredi 16 novembre 2018

Laravel 5.5 - Dynamic Route Resource

I've done some pretty thorough research into this, and can't seem to find anything on this topic. I might be searching in the wrong area or for the wrong sort of thing, a point in the right direction would help me greatly.

Basically I want to be able to use the usual Resource Controller and routes for my Baskets to achieve the urls that follow /basket/basket_type/1/item instead of basket/basket_type/basket/1/item which I know can be done (I don't like that style).

I want to be able to use the following style:

Route::group(['prefix' => 'basket'], function() { Route::resource('{basket_type}, 'BasketController'); Route::resource('{basket_type}.item, 'BasketItemController') });

Instead of having to write out each route as this feels untidy.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire