1Route::get('/menu/{category}/{product}/{item}', ['as' => 'named.route' , 'uses' => 'MenuController@listItem']);
2
3// to get the actual linke
4route('named.route', ['category' => $category->id, 'product' => $product->id, 'item' => $item->id]);
1Route::get('user/profile', [UserProfileController::class, 'show'])->name('profile');
1Route::get('/user/{name}', function ($name) {
2 //
3})->where('name', '[A-Za-z]+');
4
5Route::get('/user/{id}', function ($id) {
6 //
7})->where('id', '[0-9]+');
8
9Route::get('/user/{id}/{name}', function ($id, $name) {
10 //
11})->where(['id' => '[0-9]+', 'name' => '[a-z]+']);
12
13reference : https://laravel.com/docs/8.x/routing#parameters-regular-expression-constraints