dptgpyl61857413 2016-02-16 11:41
浏览 96

Laravel 5 MethodNotAllowedHttpException PUT

I am trying to update a user, but when I hit the submit button, Laravel throws the below error:

"RouteCollection->methodNotAllowed(array('GET', 'HEAD', 'POST')) in RouteCollection.php line 206".

I think that the PUT method is not allowed, but I do not understand the reason. The request never reaches UserController@update.

I have configured a resource route like this:

Route::resource('backend/users', 'Backend\UsersController');

The output of php artisan route:list is:

output of php artisan route:list

  • 写回答

3条回答 默认 最新

  • duanlu1908 2016-02-16 11:44
    关注

    use put method like this within form,for more https://laravel.com/docs/5.2/routing#form-method-spoofing

    {{ method_field('PUT') }}
    
    评论

报告相同问题?