以下软删除代码对我来说很好:
$post = Post::find($post_id);
$post->delete();
已删除的_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'
I'm stumped. Google is no help so far.