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
When deleting a model that has soft deletes enabled, the correct update time will be written to the database, but the model itself is not updated with the proper timestamp.
Steps To Reproduce:
I found the issue because of a very small test case that compares all attributes of a model:
// Make a test case out of it...
// Model class has created_at, updated_at and deleted_at timestamps
$model = new Model(['foo' => 'bar']);
$model->save();
sleep(2);
$model->delete();
$this->assertDatabaseHas('models', $model->getAttributes());
Result will be something like the following:
Failed asserting that a row in the table [models] matches the attributes {
"id": 1,
"foo": "bar"
"updated_at": "2017-06-08 16:31:08.000",
"created_at": "2017-06-08 16:31:08.000",
"deleted_at": "2017-06-08 16:31:10.000"
}.
Found: [
{
"id": "1",
"foo": "bar",
"created_at": "2017-06-08 16:31:08.000",
"updated_at": "2017-06-08 16:31:10.000",
"deleted_at": "2017-06-08 16:31:10.000"
}
].
The text was updated successfully, but these errors were encountered:
Description:
When deleting a model that has soft deletes enabled, the correct update time will be written to the database, but the model itself is not updated with the proper timestamp.
Steps To Reproduce:
I found the issue because of a very small test case that compares all attributes of a model:
Result will be something like the following:
The text was updated successfully, but these errors were encountered: