Method Not Allowed means the method is not right. You use patch here. But in your route file, it might've been implemented with a different method like 'put'.
Feb 5, 2023
5
Level 1
Using wildcard in vue.js script
I want to ask how to use wildcard in a script of vue.js. I thought something like this.
axios.patch("/package/" + this.id + "/update"
but I am getting an error
PATCH http://127.0.0.1:8000/edit_package/17 405 (Method Not Allowed)
, which I think is because of this. In a template, I would just do it like this
"`/package/${this.id}/update`"
, but in a script, it doesn't work. Please how can I do this?
Level 35
You need to use post from axios and the pass the patch as part of the data.
{
__method: 'PATCH'
}
1 like
Please or to participate in this conversation.