$transactionIds * @param bool $notify set to false for bulk applies, where the budget * emails would describe limits crossed long ago */ public function __construct( public array $transactionIds, public bool $notify = true, ) {} public function handle(BudgetTransactionService $service): void { Transaction::query() ->whereIn('id', $this->transactionIds) ->with('labels') ->chunkById(200, function (Collection $transactions) use ($service): void { foreach ($transactions as $transaction) { $service->assignTransaction($transaction, notify: $this->notify); } }); } }