mutate($user, $villageId, function (Simulation $sim, Village $village, CarbonImmutable $now) use ($orderId) { $order = $village->recruits->firstWhere('id', $orderId) ?? throw new GameRuleViolation('not_found', 'Order not found.'); Military::of($village, $sim)->cancel($order, $now); }); } }