Level 5
Hello, did you check your routes files ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am trying to delete a record using fetch api but I get the following error: The GET method is not supported for this route. Supported methods: DELETE.
button:
<button class="btn btn-danger btn-sm"
onclick="deletePersona({{$persona->id}})">
<i class="fas fa-times">
</i>
</button>
Code js:
function deletePersona(id) { fetch("/persona_eliminar/" + id, { method: "DELETE", }) .then((res) => res.json()) .then((response) => { console.log(response); }); }
Please or to participate in this conversation.