Skip to content

Commit e229445

Browse files
authored
only fetch soft deletes once (#55274)
1 parent 84f0178 commit e229445

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Illuminate/Database/Eloquent/MassPrunable.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ public function pruneAll(int $chunkSize = 1000)
2323

2424
$total = 0;
2525

26+
$softDeletable = in_array(SoftDeletes::class, class_uses_recursive(get_class($this)));
27+
2628
do {
27-
$total += $count = in_array(SoftDeletes::class, class_uses_recursive(get_class($this)))
29+
$total += $count = $softDeletable
2830
? $query->forceDelete()
2931
: $query->delete();
3032

0 commit comments

Comments
 (0)