If the method is not allowed, this is probably due to the definition of the route.
Can you show the route please ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
This request fails with error 405 Method Not Allowed
fetch(`/posts/${id}`, {
method: 'DELETE',
headers: {
'X-CSRF-TOKEN': document.head.querySelector('meta[name=csrf-token]').content,
}
})
.catch((error) => {
console.log(error);
})
.finally(() => {
});
Please or to participate in this conversation.