我已经完成了创建,编辑和更新现在我正在尝试使用id删除记录,但它正在抛出异常MethodNotAllowedHttpException in RouteCollection.php line 219:
,我做错了。
路线:
Route::delete('authors/{id}/delete', array('as' => 'delete_route', 'uses' => 'authors_controller@delete'));
控制器:
public function delete($id){
$author = author::find($id);
$author->delete();
return redirect('authors');
}
形式:
{!! Form::open($author, ['method'=> 'delete', 'url' => 'authors/' . $author->id . '/delete']) !!}
{!! Form::close() !!}