We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 81a66e5 commit c2ef7ccCopy full SHA for c2ef7cc
resources/views/categories/index.blade.php
@@ -22,7 +22,12 @@
22
<td>{{ $category->name }}</td>
23
<td>
24
<a class="btn btn-primary" href="{{ route('categories.edit', $category->id) }}">Edit</a>
25
- <a class="btn btn-danger" href="{{ route('categories.destroy', $category->id) }}">Delete</a>
+ {{-- Delete always will be a Form with method POST --}}
26
+ <form method="POST" action="{{ route('categories.destroy', $category->id) }}" class="d-inline">
27
+ <input type="submit" class="btn btn-danger" value="Delete" onclick="confirm('Are you sure about this?')"/>
28
+ @method('DELETE')
29
+ @csrf
30
+ </form>
31
</td>
32
</tr>
33
@endforeach
0 commit comments