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