我想通過控制器更新數據。但我收到此錯誤:The PUT method is not supported for this route. Supported methods: GET, HEAD.我正在使用 {{method_field('PUT')}}。為什么會出現此錯誤?路線:Route::post('updateColors/{color}', 'Admin\UserController@updateColor')->name('updateColors');控制器:public function updateColor(Request $request, Color $color){...}在視圖中:<form action="{{route('updateColors',$color)}}" method="POST">...@csrf{{method_field('PUT')}}</form>
- 1 回答
- 0 關注
- 129 瀏覽
添加回答
舉報
0/150
提交
取消