I get the following error with the code below.
The DELETE method is not supported for this route. Supported methods: GET, HEAD, POST
Controller
public function destroy(Post $post)
{
$post->delete();
return back();
}
Route
Route::delete('/posts/{post}', [PostController::class, 'destroy']);
View
<form action="{{ route('posts', $post) }}" method="POST" >
@csrf
@method('delete')
<button type="submit" class="text-blue-500">Delete</button>
</form>