$targets the selection, narrowed to the rows the caller may change * @return int how many rows were changed */ public function handle(Builder $targets, BulkTarget $target, ProductStatus $to): int { $count = $targets->update(['status' => $to->value]); if ($count > 0) { activity() ->event('updated') ->withProperties([...$target->describe($count), 'status' => $to->value]) ->log("Bulk set {$count} products to {$to->value}"); ProductStats::forget(); } return $count; } }