2016-07-29 169 views
0

我得到這個錯誤:MethodNotAllowedHttpException在RouteCollection.php - laravel

MethodNotAllowedHttpException in RouteCollection.php line 218 

我覺得一切都很好:

我的表格:

<form method="post" action="{{URL::to('/').'/cp/user/search'}}" > 

我的路由器:

Route::post('cp/user/search','Panel\[email protected]'); 

我的控制器:

public function usersSearch(Request $request) 
{ 
    $posts = $request->input(); 

    var_dump($posts['fname']); 

} 
+0

應該不是你的路由器是'路線::後( '/ CP /用戶/搜索',「面板\ UserController的@ usersSearch');'? – charmeleon

+0

不......我一直在測試它。 –

+1

嘗試'{{url('/ cp/user/search')}}'作爲動作 – manniL

回答

0

您可以使用

<form method="post" action="{{ url('/cp/user/search') }}" > 

希望這將解決您的問題

相關問題