2015-12-06 18:58:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Model Factories
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here you may define all of your model factories. Model factories give
|
|
|
|
| you a convenient way to create models for testing and seeding your
|
|
|
|
| database. Just tell the factory how a default model should look.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2017-07-23 01:15:01 +00:00
|
|
|
\Sofa\Eloquence\Model::unsetEventDispatcher();
|
|
|
|
|
|
|
|
$factory->define(Pterodactyl\Models\Server::class, function (Faker\Generator $faker) {
|
|
|
|
return [
|
|
|
|
'id' => $faker->randomNumber(),
|
|
|
|
'uuid' => $faker->uuid,
|
|
|
|
'uuidShort' => str_random(8),
|
|
|
|
'name' => $faker->firstName,
|
|
|
|
'description' => implode(' ', $faker->sentences()),
|
|
|
|
'skip_scripts' => 0,
|
|
|
|
'suspended' => 0,
|
|
|
|
'memory' => 512,
|
|
|
|
'swap' => 0,
|
|
|
|
'disk' => 512,
|
|
|
|
'io' => 500,
|
|
|
|
'cpu' => 0,
|
|
|
|
'oom_disabled' => 0,
|
|
|
|
'pack_id' => null,
|
|
|
|
'daemonSecret' => $faker->uuid,
|
|
|
|
'username' => $faker->userName,
|
|
|
|
'sftp_password' => null,
|
|
|
|
'installed' => 1,
|
|
|
|
'created_at' => \Carbon\Carbon::now(),
|
|
|
|
'updated_at' => \Carbon\Carbon::now(),
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2015-12-06 18:58:49 +00:00
|
|
|
$factory->define(Pterodactyl\Models\User::class, function (Faker\Generator $faker) {
|
|
|
|
return [
|
2017-07-23 01:15:01 +00:00
|
|
|
'id' => $faker->randomNumber(),
|
2017-06-14 04:25:37 +00:00
|
|
|
'external_id' => null,
|
|
|
|
'uuid' => $faker->uuid,
|
|
|
|
'username' => $faker->userName,
|
|
|
|
'email' => $faker->safeEmail,
|
|
|
|
'name_first' => $faker->firstName,
|
|
|
|
'name_last' => $faker->lastName,
|
|
|
|
'password' => bcrypt('password'),
|
|
|
|
'language' => 'en',
|
|
|
|
'root_admin' => false,
|
|
|
|
'use_totp' => false,
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
$factory->state(Pterodactyl\Models\User::class, 'admin', function () {
|
|
|
|
return [
|
|
|
|
'root_admin' => true,
|
2015-12-06 18:58:49 +00:00
|
|
|
];
|
|
|
|
});
|
2017-06-16 04:03:22 +00:00
|
|
|
|
|
|
|
$factory->define(Pterodactyl\Models\Location::class, function (Faker\Generator $faker) {
|
|
|
|
return [
|
|
|
|
'short' => $faker->domainWord,
|
|
|
|
'long' => $faker->catchPhrase,
|
|
|
|
];
|
|
|
|
});
|
2017-06-16 05:29:19 +00:00
|
|
|
|
|
|
|
$factory->define(Pterodactyl\Models\Node::class, function (Faker\Generator $faker) {
|
|
|
|
return [
|
|
|
|
'public' => true,
|
|
|
|
'name' => $faker->firstName,
|
|
|
|
'fqdn' => $faker->ipv4,
|
|
|
|
'scheme' => 'http',
|
|
|
|
'behind_proxy' => false,
|
|
|
|
'memory' => 1024,
|
|
|
|
'memory_overallocate' => 0,
|
|
|
|
'disk' => 10240,
|
|
|
|
'disk_overallocate' => 0,
|
|
|
|
'upload_size' => 100,
|
|
|
|
'daemonSecret' => $faker->uuid,
|
|
|
|
'daemonListen' => 8080,
|
|
|
|
'daemonSFTP' => 2022,
|
|
|
|
'daemonBase' => '/srv/daemon',
|
|
|
|
];
|
|
|
|
});
|
2017-07-23 01:15:01 +00:00
|
|
|
|
|
|
|
$factory->define(Pterodactyl\Models\ServiceVariable::class, function (Faker\Generator $faker) {
|
|
|
|
return [
|
|
|
|
'id' => $faker->randomNumber(),
|
|
|
|
'name' => $faker->firstName,
|
|
|
|
'description' => $faker->sentence(),
|
|
|
|
'env_variable' => strtoupper(str_replace(' ', '_', $faker->words(2, true))),
|
|
|
|
'default_value' => $faker->colorName,
|
|
|
|
'user_viewable' => 0,
|
|
|
|
'user_editable' => 0,
|
|
|
|
'rules' => 'required|string',
|
|
|
|
'created_at' => \Carbon\Carbon::now(),
|
|
|
|
'updated_at' => \Carbon\Carbon::now(),
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
$factory->state(Pterodactyl\Models\ServiceVariable::class, 'viewable', function () {
|
|
|
|
return ['user_viewable' => 1];
|
|
|
|
});
|
|
|
|
|
|
|
|
$factory->state(Pterodactyl\Models\ServiceVariable::class, 'editable', function () {
|
|
|
|
return ['user_editable' => 1];
|
|
|
|
});
|