clock->now(); return $this->transactions->run(function () use ($userId, $start, $approverId, $now): int { $approved = 0; foreach ($this->entries->forUserBetween($userId, $start, $start->modify('+6 days')) as $entry) { if ($entry->isApproved()) { continue; } $entry->approve($approverId, $now); $this->entries->save($entry); $approved++; } return $approved; }); } }