这些是我面临问题的路线
获取特定城市注册地点列表的路线
例如: http://localhost:8000/London , http://localhost:8000/London/Restaurants
Route::group(['namespace' => 'Page'], function() {
Route::group(['prefix' => '{city}', 'where' => ['city' => '[\w\d]+']], function() {
Route::get('/', 'CityPageController@showCityPage')->name('cityPage');
});
});
获取特定用户配置文件及其详细信息(如评论、照片等)的路由。
例如: http://localhost:8000/John、http://localhost:8000/John/reviews、http://localhost:8000/John/photos
Route::group(['namespace' => 'User'], function() {
Route::group(['middleware' => 'verified'], function() {
Route::group(['prefix' => '{username}', 'where' => ['username' => '[\w\d]+']], function() {
Route::get('/', 'ProfileController@showProfilePage')->name('profilePage');
Route::get('/reviews', 'ReviewController@showReviewPage')->name('reviewPage');
Route::get('/photos', 'ImageController@showPhotoPage')->name('photoPage');
});
});
});
问题是这两条路线没有同时工作。
位于另一条之上的路线优先于另一条路线。
如何解决这个路由问题。
编辑
我知道有一种方法可以实现此功能,但我不知道如何。任何帮助表示赞赏。