I wanna create url like this
http://example.com/url1/product/blabla http://example.com/url2/product/aiueo
I can't achieve with this
Route::prefix('{page}')->name('the_url')->group(function () {
Route::get('/', 'HomeController@page')
->name('index');
})->where('page', '(url1|url2)');
Or should I use the where()
in every method inside the {page}
prefix?
You can use it with group like this:
Route::group([
'as' => 'the_url',
'prefix' => '{page}',
'where' => [
'page' => 'url1|url2'
],
], function () {
// Group routes
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With