0
I have a Blade view with the following structure:
@forelse($posts as $p)
<tr>
<td><a href="/post/{{ $p->id }}">{{ $p->titulo }}</a></td>
<td>{{ $p->status_mutator }}</td>
<td>{{ $p->user->name }}</td>
<td>{{ $p->created_at->format('d/m/Y à\s H:i:s')}}</td>
<td>
<a href="/painel/post/{{ $p->id }}/edit">Editar</a> /
<a href="/painel/post/{{ $p->id }}">Excluir</a>
</td>
</tr>
@empty
<tr>
<td colspan="5">Não existem posts para serem listados</td>
</tr>
@endforelse
But my route uses the Resource structure, IE, I have to submit the Delete option via DELETE method. Any idea how to do this?
Deleting something through a simple link is unsafe. Better you create a form, set the "DELETE" method for the route and use a button or an event in a link that submits the form
– mau humor
Yes the idea is this. As I said I want to use the method DELETE (DELETE verb) via form. I just need help to build something in Javascript that captures the id of the clicked link and submit the form
– Fábio Jânio