diff --git a/database/factories/ApiKeyFactory.php b/database/factories/ApiKeyFactory.php index eb1a10f5..488c26cd 100644 --- a/database/factories/ApiKeyFactory.php +++ b/database/factories/ApiKeyFactory.php @@ -3,6 +3,7 @@ namespace Database\Factories; use Carbon\Carbon; +use Illuminate\Support\Str; use Pterodactyl\Models\ApiKey; use Illuminate\Database\Eloquent\Factories\Factory; @@ -26,8 +27,8 @@ class ApiKeyFactory extends Factory return [ 'key_type' => ApiKey::TYPE_APPLICATION, - 'identifier' => str_random(\Pterodactyl\Models\ApiKey::IDENTIFIER_LENGTH), - 'token' => $token ?: $token = encrypt(str_random(\Pterodactyl\Models\ApiKey::KEY_LENGTH)), + 'identifier' => Str::random(\Pterodactyl\Models\ApiKey::IDENTIFIER_LENGTH), + 'token' => $token ?: $token = encrypt(Str::random(\Pterodactyl\Models\ApiKey::KEY_LENGTH)), 'allowed_ips' => null, 'memo' => 'Test Function Key', 'created_at' => Carbon::now(), diff --git a/database/factories/EggVariableFactory.php b/database/factories/EggVariableFactory.php index 5533056c..d5b6596a 100644 --- a/database/factories/EggVariableFactory.php +++ b/database/factories/EggVariableFactory.php @@ -2,6 +2,7 @@ namespace Database\Factories; +use Illuminate\Support\Str; use Pterodactyl\Models\EggVariable; use Illuminate\Database\Eloquent\Factories\Factory; @@ -24,7 +25,7 @@ class EggVariableFactory extends Factory return [ 'name' => $this->faker->firstName, 'description' => $this->faker->sentence(), - 'env_variable' => strtoupper(str_replace(' ', '_', $this->faker->words(2, true))), + 'env_variable' => Str::upper(Str::replaceArray(' ', [ '_' ], $this->faker->words(2, true))), 'default_value' => $this->faker->colorName, 'user_viewable' => 0, 'user_editable' => 0, diff --git a/database/factories/ServerFactory.php b/database/factories/ServerFactory.php index 23f74793..20f49aad 100644 --- a/database/factories/ServerFactory.php +++ b/database/factories/ServerFactory.php @@ -3,6 +3,7 @@ namespace Database\Factories; use Carbon\Carbon; +use Illuminate\Support\Str; use Pterodactyl\Models\Server; use Illuminate\Database\Eloquent\Factories\Factory; @@ -24,7 +25,7 @@ class ServerFactory extends Factory { return [ 'uuid' => $this->faker->unique()->uuid, - 'uuidShort' => str_random(8), + 'uuidShort' => Str::random(8), 'name' => $this->faker->firstName, 'description' => implode(' ', $this->faker->sentences()), 'skip_scripts' => 0,