$this->faker->userName(), 'kind' => VpnPeer::KIND_STAFF, 'user_id' => Operator::factory()->role('Admin'), 'public_key' => Keypair::generate()->publicKey, 'allowed_ip' => '10.66.0.'.($octet++), 'enabled' => true, 'present' => true, ]; } /** A peer registered by the host pipeline: no human owner. */ public function forHost(): static { return $this->state(['kind' => VpnPeer::KIND_HOST, 'user_id' => null]); } public function ownedBy(Operator $operator): static { return $this->state(['kind' => VpnPeer::KIND_STAFF, 'user_id' => $operator->id]); } public function blocked(): static { return $this->state(['enabled' => false, 'present' => false]); } }