vito/database/factories/ServerFactory.php
2025-03-12 13:31:10 +01:00

40 lines
1003 B
PHP
Executable File

<?php
namespace Database\Factories;
use App\Enums\OperatingSystem;
use App\Enums\ServerProvider;
use App\Enums\ServerStatus;
use App\Enums\ServerType;
use App\Models\Server;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<\App\Models\Server>
*/
class ServerFactory extends Factory
{
protected $model = Server::class;
public function definition(): array
{
return [
'name' => $this->faker->name(),
'ssh_user' => 'vito',
'ip' => $this->faker->ipv4(),
'local_ip' => $this->faker->ipv4(),
'port' => 22,
'os' => OperatingSystem::UBUNTU22,
'type' => ServerType::REGULAR,
'provider' => ServerProvider::CUSTOM,
'authentication' => [
'user' => 'vito',
'pass' => 'password',
],
'public_key' => 'test',
'status' => ServerStatus::READY,
'progress' => 100,
];
}
}