1

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

2
  • 1
    did you tried by changing to axios.post instead ? Are you sure this `/admin/slideUpdate/${this.list.id}` make right path ? Commented Apr 21, 2018 at 16:51
  • 1
    you are posting data via patch and receiving it in post, update your route aswell to PUT or PATCH instead post Commented Apr 21, 2018 at 16:52

1 Answer 1

2

Change your route to:

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

Hope it helps...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.