The following soft delete code works fine for me:
$post = Post::find($post_id);
$post->delete();
The deleted_at field is updated. But this gives me an error:
$post = Post::find($post_id);
$post->restore();
Here's the error:
exception 'SymfonyComponentDebugExceptionFatalErrorException' with message 'Call to a member function restore() on a non-object'
I'm stumped. Google is no help so far.
question from:https://stackoverflow.com/questions/25576024/laravel-soft-delete-restore-error