This can be solved by defining routes as follows:
Route::get('/{userId}/{profile}')->with('profile', '(?i)profile(?-i)');
Even smarter, define it as a pattern , then it will also be available in route groups.
Route::pattern('profile', '(?i)profile(?-i)'); Route::get('/{userId}/{profile}');
preyz source share