Skip to content

Commit 17163b4

Browse files
authored
Revert "Fix SoftDeletes Query (#26396)" (#26406)
This reverts commit d05f93e.
1 parent d05f93e commit 17163b4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Illuminate/Database/Eloquent/SoftDeletes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function performDeleteOnModel()
4949
if ($this->forceDeleting) {
5050
$this->exists = false;
5151

52-
return $this->setKeysForSaveQuery($this->newModelQuery())->forceDelete();
52+
return $this->newModelQuery()->where($this->getKeyName(), $this->getKey())->forceDelete();
5353
}
5454

5555
return $this->runSoftDelete();
@@ -62,7 +62,7 @@ protected function performDeleteOnModel()
6262
*/
6363
protected function runSoftDelete()
6464
{
65-
$query = $this->setKeysForSaveQuery($this->newModelQuery());
65+
$query = $this->newModelQuery()->where($this->getKeyName(), $this->getKey());
6666

6767
$time = $this->freshTimestamp();
6868

tests/Database/DatabaseSoftDeletingTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testDeleteSetsSoftDeletedColumn()
1919
$model = m::mock(DatabaseSoftDeletingTraitStub::class);
2020
$model->shouldDeferMissing();
2121
$model->shouldReceive('newModelQuery')->andReturn($query = m::mock(stdClass::class));
22-
$model->shouldReceive('setKeysForSaveQuery')->once()->with($query)->andReturn($query);
22+
$query->shouldReceive('where')->once()->with('id', 1)->andReturn($query);
2323
$query->shouldReceive('update')->once()->with([
2424
'deleted_at' => 'date-time',
2525
'updated_at' => 'date-time',

0 commit comments

Comments
 (0)