get factories to use other uuid generator rather than faker

This commit is contained in:
Matthew Penner
2021-01-16 14:01:26 -07:00
parent 1b05ca10e4
commit 59c71f0862
4 changed files with 10 additions and 5 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
namespace Database\Factories;
use Ramsey\Uuid\Uuid;
use Pterodactyl\Models\Egg;
use Illuminate\Database\Eloquent\Factories\Factory;
@@ -22,7 +23,7 @@ class EggFactory extends Factory
public function definition(): array
{
return [
'uuid' => $this->faker->unique()->uuid,
'uuid' => Uuid::uuid4()->toString(),
'name' => $this->faker->name,
'description' => implode(' ', $this->faker->sentences()),
'startup' => 'java -jar test.jar',
+2 -1
View File
@@ -2,6 +2,7 @@
namespace Database\Factories;
use Ramsey\Uuid\Uuid;
use Pterodactyl\Models\Nest;
use Illuminate\Database\Eloquent\Factories\Factory;
@@ -22,7 +23,7 @@ class NestFactory extends Factory
public function definition(): array
{
return [
'uuid' => $this->faker->unique()->uuid,
'uuid' => Uuid::uuid4()->toString(),
'author' => 'testauthor@example.com',
'name' => $this->faker->word,
'description' => null,
+2 -1
View File
@@ -2,6 +2,7 @@
namespace Database\Factories;
use Ramsey\Uuid\Uuid;
use Illuminate\Support\Str;
use Pterodactyl\Models\Node;
use Illuminate\Support\Facades\Crypt;
@@ -24,7 +25,7 @@ class NodeFactory extends Factory
public function definition(): array
{
return [
'uuid' => $this->faker->unique()->uuid,
'uuid' => Uuid::uuid4()->toString(),
'public' => true,
'name' => $this->faker->firstName,
'fqdn' => $this->faker->ipv4,
+4 -2
View File
@@ -26,7 +26,7 @@ class ServerFactory extends Factory
{
return [
'uuid' => Uuid::uuid4()->toString(),
'uuidShort' => Str::random(8),
'uuidShort' => Str::lower(Str::random(8)),
'name' => $this->faker->firstName,
'description' => implode(' ', $this->faker->sentences()),
'skip_scripts' => 0,
@@ -36,10 +36,12 @@ class ServerFactory extends Factory
'disk' => 512,
'io' => 500,
'cpu' => 0,
'threads' => null,
'oom_disabled' => 0,
'installed' => 1,
'database_limit' => null,
'allocation_limit' => null,
'database_limit' => null,
'backup_limit' => null,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
];