我在模型文章中使用软删除,但在模型注释中不使用软删除。我还使用模型文章中的段塞列定制了键。如果这篇文章被删除了,我还想显示评论。但是当文章被删除时,show方法总是返回404。 { throw new NotFoundHttpException('Record Not Found.');
return $t
我正在尝试实现一个直接在belongsTo上的->withTrashed()作用域的->withTrashed()关系。<?public function contract_type_with_trashed() return $this->belongsTo(ContractType::class)->withTrashed我可以补充说,做$employee->contract_type()->withTrashed()->g
下面的软删除代码对我来说很好用:$post->delete();$post = Post::find($post_id);下面是错误:
exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to a member function restore() on a non-object'