Method not allowed when PUT used over AJAX for Laravel resource

前端 未结 1 1077
闹比i
闹比i 2020-12-20 16:02

I\'ve got this resource in routes.php:

Route::resource(\'items\', \'ItemsController\', [\'before\' => \'admin_access\']);

Trying to reac

相关标签:
1条回答
  • 2020-12-20 16:31

    Most browsers can't send PUT methods and are restricted to just GET and POST.

    Try changing the method to POST, but leave your _method element in the data array to spoof the request method.

    0 讨论(0)
提交回复
热议问题