хочу осуществить удаление поста по кнопке, но выходит ошибка, что такого роута не существует.
show.blade.php:
@extends('layouts.main')
@section('content')
<div class="post">
<h3 class="post-title">{{$post->title}}</h3>
<a href="{{route('post.store')}}">back</a>
<a href="{{route('post.edit', $post->id)}}">edit</a>
<form method="POST" action="{{route('post.destroy', $post->id)}}">
@method('DELETE')
@csrf
<input type="submit" value="delete">
</form>
</div>
@endsection
web.php:
Route::get('/', function () {return view('main');})->name('main.index');
Route::get('/posts', 'PostController@index')->name('post.index');
Route::get('/posts/create', 'PostController@create')->name('post.create');
Route::post('/posts', 'PostController@store')->name('post.store');
Route::get('/posts/{post}', 'PostController@show')->name('post.show');
Route::get('/posts/{post}/edit', 'PostController@edit')->name('post.edit');
Route::patch('/posts/{post}', 'PostController@update')->name('post.update');
Route::delete('/posts/{post}', 'PostController@destroy')->name('post.destroy');
PostController.php:
public function destroy(Post $post) {
$post->delete();
return redirect()->route('post.index');
}