2021-01-23 12:09:16 -08:00
|
|
|
<?php
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2021-01-23 12:09:16 -08:00
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
2026-10-05 18:10:18 -04:00
|
|
|
use Illuminate\Support\Facades\Crypt;
|
|
|
|
|
use Pterodactyl\Models\DatabaseHost;
|
|
|
|
|
use Pterodactyl\Models\Node;
|
2021-01-23 12:09:16 -08:00
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
/**
|
|
|
|
|
* @extends Factory<DatabaseHost>
|
|
|
|
|
*/
|
2021-01-23 12:09:16 -08:00
|
|
|
class DatabaseHostFactory extends Factory
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $model = DatabaseHost::class;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Define the model's default state.
|
|
|
|
|
*/
|
|
|
|
|
public function definition(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
2026-10-05 18:10:18 -04:00
|
|
|
'node_id' => Node::factory()->withLocation(),
|
|
|
|
|
'name' => fake()->colorName(),
|
|
|
|
|
'host' => fake()->unique()->ipv4(),
|
2021-01-23 12:09:16 -08:00
|
|
|
'port' => 3306,
|
2026-10-05 18:10:18 -04:00
|
|
|
'username' => fake()->colorName(),
|
|
|
|
|
'password' => Crypt::encrypt(fake()->word()),
|
2021-01-23 12:09:16 -08:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|