I am trying to use Resource Controller and having a problem with destroying method, can't find a solution.
I get this error
The DELETE method is not supported for this route. Supported methods: GET, HEAD, POST.
web.php
Route::resource('honor', 'HonorController');
HonorController.php
public function destroy(Honor $honor)
{
dd($honor);
$honor->delete();
return redirect()->back();
}
blade
<form action="{{ route('honor.destroy', $honor->id) }}" method="post">
@csrf
@method('DELETE')
<div class="btn-group">
<a href="{{ route('honor.edit', $honor->id) }}" class="btn btn-info btn-sm">Edit</a>
<button type="submit" class="btn btn-danger btn-sm">Delete</button>
</div>
</form>