9
下面的軟刪除代碼工作正常,我:Laravel軟刪除恢復()錯誤
$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'
我難倒。谷歌迄今爲止沒有幫助。
就像一個魅力返回丟棄記錄。謝謝。 – moreirapontocom 2017-09-18 14:10:41