You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently models get dirty (isDirty() == true) after both force-deletion and soft-deletion.
Force-deletion
Correct behavior. After deletion, the model doesn't exist anymore: $exists = false. We cannot sync the latest attributes from database.
Soft-deletion
Wrong behavior. After deletion, the model still exists: $exists = true. We should be able to retrieve the latest attributes or immediately restore the data. Currently, immediate restore() call just after delete() has a broken behavior.SoftDeletes should call syncOriginal() after UPDATE query execution.
Steps To Reproduce:
$softDeletable->delete();
$softDeletable->restore(); // It does't execute any queries
$softDeletable->delete();
$softDeletable->refresh();
$softDeletable->restore(); // It works