$this->faker->unique()->ipv4(), // stay above the ports some tests hardcode (e.g. 5000-5005) on the // same node and ip, otherwise the unique (node_id, ip, port) index // makes those tests randomly fail 'port' => $this->faker->unique()->numberBetween(10000, 65535), 'node_id' => Node::factory(), ]; } /** * Attaches the allocation to a specific server model. */ public function forServer(Server $server): self { return $this->for($server)->for($server->node); } }