我在我的路由文件中使用Route::delete()
方法。在我將應用程序移到新服務器之前,我沒有使用這種方法的問題,但現在我得到了MethodNotAllowedHttpException
。我使用該應用程序約6個月沒有任何問題。但是現在我在每個刪除過程中都得到了這一點當然,當我將方法更改爲post
並添加一個隱藏變量_method
它的作品。但是我想知道在新的服務器上會有什麼設置(設置)。有任何想法嗎?什麼是服務器端問題,可能會導致MethodNotAllowedHttpException
異常詳細信息:
MethodNotAllowedHttpException in RouteCollection.php line 218:
in RouteCollection.php line 218
at RouteCollection->methodNotAllowed(array('DELETE')) in RouteCollection.php line 205
at RouteCollection->getRouteForMethods(object(Request), array('DELETE')) in RouteCollection.php line 158
at RouteCollection->match(object(Request)) in Router.php line 821
at Router->findRoute(object(Request)) in Router.php line 691
at Router->dispatchToRoute(object(Request)) in Router.php line 675
at Router->dispatch(object(Request)) in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 132
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 5
打開git的,看看最近更改。有你的解決方案。 – Kyslik
客戶端是否有任何更改會觸發請求。因爲html表格不支持放,修補和刪除 –
嘗試清除緩存'php artisan route:clear' – mrabbani