Files
pterodactyl-panel/database/Factories/DatabaseHostFactory.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

39 lines
869 B
PHP

<?php
declare(strict_types=1);
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Crypt;
use Pterodactyl\Models\DatabaseHost;
use Pterodactyl\Models\Node;
/**
* @extends Factory<DatabaseHost>
*/
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 [
'node_id' => Node::factory()->withLocation(),
'name' => fake()->colorName(),
'host' => fake()->unique()->ipv4(),
'port' => 3306,
'username' => fake()->colorName(),
'password' => Crypt::encrypt(fake()->word()),
];
}
}