BadMethodCallException в строке 74 Macroable.php: Удаление метода
не существует.
маршрут:
Код: Выделить всё
Route::resource('posts', 'PostController');
Код: Выделить всё
public function destroy($id)
{
$user_id = Auth::user();
$post= Post::where('id', $id)->where('user_id',$user_id)->get();
$post->delete();
return view('/home', [
'posts' => $post
]);
}
Код: Выделить всё
{{ csrf_field() }}
{{ method_field('DELETE') }}
Подробнее здесь: https://stackoverflow.com/questions/438 ... -not-exist
Мобильная версия