2017-09-08 1 views
0

는 HTTP/routes.php내 라우팅 laravel에서 제대로 작동하지 않습니다 여기에

Route::get('/{buy_type}-property/{type}-in-{city}/{location}/project/{projname}/{section}', 'APP\[email protected]')->where('projname', '[A-Za-z0-9_\-A-Za-z0-9_\-]+')->where('location','[A-Za-z0-9_\-A-Za-z0-9_\-]+')->where('section', '[A-Za-z0-9_\-A-Za-z0-9_\-]+'); 

그리고 두 번째에서 언급 한 내 두 경로가이

Route::get('/{buy_type}-property/{type}-in-{city}/{location}/project/{clustername}/{projname}', array('as' => 'project-with-cluster', 'uses' => 'APP\[email protected]'))->where('projname', '[A-Za-z0-9_\-A-Za-z0-9_\-]+')->where('location','[A-Za-z0-9_\-A-Za-z0-9_\-]+'); 

내가 {섹션에 따라 조건부 경로를 원하는 것입니다 } 매개 변수를 사용합니다. 두 경로 모두 동일한 매개 변수를 가지고 있으므로 두 번째 호출은 호출되지 않습니다. 누군가가 나에게 거의 일주일 동안 힘이 없다고 제안 할 수 있습니까?

답변

0

당신은 당신의 길을 구조 다시 할 수 있습니다

Route::get('/{buy_type}-property/{type}-in-{city}/{location}/project/{projname}/cluster/{clustername}', array('as' => 'project-with-cluster', 'uses' => 'APP\[email protected]'))->where('projname', '[A-Za-z0-9_\-A-Za-z0-9_\-]+')->where('location','[A-Za-z0-9_\-A-Za-z0-9_\-]+'); 
관련 문제