问题
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