0
나는 다음과 같은 경로가 있습니다Laravel 웹 경로 변수는 생각으로 반환하지 않습니다
Route::get('/web/{cat_id?}/{post_type}','[email protected]')
->where('post_type', '(pictures|videos|links|companies)')
->name('post_index');
컨트롤러 파일 :
public function index($post_type,$post_id = null,$cat_id = null)
{
dd($post_type);
}
액세스 URL/공공/웹/15/비디오 그것은 반환 {cat_id?} 값을 반환하는 동안 {post_type} 값 (동영상)을 반환해야하는 '15'입니다.
색인 방법에서 post_id 란 무엇입니까? – C2486
경로 앞에 그룹이 있습니까? – C2486