Add forNetwork method to ServerFactory and update DatabaseSeeder to associate servers with a network

This commit is contained in:
2025-04-07 19:13:50 +01:00
parent 2b0f41cd7c
commit 2e2c0a033b
2 changed files with 19 additions and 2 deletions

View File

@@ -31,6 +31,15 @@ class ServerFactory extends Factory
];
}
public function forNetwork(string $networkId): static
{
return $this->state(function (array $attributes) use ($networkId) {
return [
'external_network_id' => $networkId,
];
});
}
public function forOrganisation(int $organisationId): static
{
return $this->state(function (array $attributes) use ($organisationId) {