我尝试过这种方法,但没有成功,我一直遇到错误。
调用非对象上的成员函数delete()
Post::find($id)->delete();
关系:
public function posts()
{
return $this->hasMany('Post');
}
public function user()
{
return $this->belongsTo('User');
}
使用此解决方案。
{{ Form::open(array('method'=>'DELETE', 'route'=>array('post.delete', $post->id))) }}