我想知道是否有人可以查看此代码并告诉我为什么它不起作用。当我按下提交按钮时,它不会提交。
{!! Form::open([
'method' => 'DELETE',
'route' => ['posts.destroy', $post->id],
'style' => 'display: inline'
]) !!}
{!! Form::submit('Delete this post?', ['class' => 'btn btn-danger']) !!}
{!! Form::close() !!}
我将它提交给 PostController 的 destory 方法,其中路由定义为“posts”。
路由文件
Route::group(['prefix' => 'admin'], function() {
Route::resource('posts', 'PostController');
});