$targets the selection in the trash, narrowed to the rows the caller may change * @return int how many rows were changed */ public function handle(Builder $targets, BulkTarget $target): int { $count = DB::transaction(function () use ($targets): int { $count = 0; foreach ($targets->lazyById() as $row) { $this->forceDelete->handle($row); $count++; } return $count; }); if ($count > 0) { activity() ->event('force-deleted') ->withProperties($target->describe($count)) ->log("Bulk permanently deleted {$count} products"); ProductStats::forget(); } return $count; } }