【发布时间】:2014-10-23 22:08:50
【问题描述】:
以下软删除代码对我来说很好用:
$post = Post::find($post_id);
$post->delete();
deleted_at 字段已更新。但这给了我一个错误:
$post = Post::find($post_id);
$post->restore();
这是错误:
exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to a member function restore() on a non-object'
我被难住了。到目前为止,Google 没有任何帮助。
【问题讨论】:
标签: laravel eloquent soft-delete