PATCH 405 (Method Not Allowed) VueJs

此生再无相见时 提交于 2021-02-17 04:42:20

问题


I have route in group 'prefix'=>'admin' in web.php

Route::post('/slideUpdate/{id}','SlideController@postSlideUpdate')

In Add.vue i call function update() in methods

axios.patch(`/admin/slideUpdate/${this.list.id}`,this.$data.list)

In SlideController i have function

public function postSlideUpdate(Request $request,$id)
{
    $product = Slide::find($request->id);..$product->save();
}

When i click button @click="update"i get error

PATCH http://minhquanbicycle.com/admin/slideUpdate/1 405 (Method Not Allowed)

Thanks


回答1:


Change your route to:

Route::patch('/slideUpdate/{id}','SlideController@postSlideUpdate')

Hope it helps...



来源:https://stackoverflow.com/questions/49957982/patch-405-method-not-allowed-vuejs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!