35 lines
837 B
PHP
35 lines
837 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Host;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/** @extends Factory<Host> */
|
|
class HostFactory extends Factory
|
|
{
|
|
protected $model = Host::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'name' => 'pve-test-'.$this->faker->unique()->numberBetween(1, 99999),
|
|
'datacenter' => 'fsn',
|
|
'public_ip' => $this->faker->ipv4(),
|
|
'status' => 'pending',
|
|
];
|
|
}
|
|
|
|
public function active(): static
|
|
{
|
|
return $this->state(fn () => [
|
|
'status' => 'active',
|
|
'wg_ip' => '10.66.0.'.$this->faker->numberBetween(2, 250),
|
|
'total_gb' => 1000,
|
|
'total_ram_mb' => 65536,
|
|
'cpu_cores' => 16,
|
|
'cpu_weight' => 16,
|
|
]);
|
|
}
|
|
}
|