次のソフト削除コードは私にとってはうまくいきます:
$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 は今のところ役に立ちません。