I need to create a route with some fixed and dynamic parts. Basically I need to be flexible on the second segment on the url. If the url starts with 'products/test....' then the route has to go to the PageController, all other routes starting with 'products/....' have to go to the ProductController.
// Something like this:
Route::any('products/".starts_with($slug, 'test'), [
'uses' => 'PageController@show'
])->where('slug', '(.*)?');
Route::get('products/{slug}', [
'uses' => 'ProductController@show'
]);
Is this possible in Laravel 5?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire