transactions->run(function () use ($userId, $start): int { $cancelled = 0; foreach ($this->entries->forUserBetween($userId, $start, $start->modify('+6 days')) as $entry) { if (! $entry->isApproved() || $entry->isBilled()) { continue; } $entry->cancelApproval(); $this->entries->save($entry); $cancelled++; } return $cancelled; }); } }