MethodNotAllowedHttpException in RouteCollection.php line 218:4

后端 未结 3 1689
灰色年华
灰色年华 2021-01-22 06:52

I will get MethodNotAllowedHttpException when submitting a form in laravel

Html file

id}}/notes\"&g
3条回答
  •  深忆病人
    2021-01-22 07:22

    MethodNotAllowedHttpException is thrown when no matching route (method and URI) was found, but a route with a matching URI but not matching method was found.

    In your case, I guess the issue is because URI parameters differ between the route and the controller.

    Here are two alternatives you can try:

    1. Remove the parameter from your route:
    Route::post('cards/notes','NotesController@store');
    
    1. Add the parameter to your controller:
        public function store($card)
        {
            return request()->all();
        }
    

提交回复
热议问题