Path: blob/1.0-develop/database/Factories/ServerFactory.php
7460 views
<?php12namespace Database\Factories;34use Carbon\Carbon;5use Ramsey\Uuid\Uuid;6use Illuminate\Support\Str;7use Pterodactyl\Models\Server;8use Illuminate\Database\Eloquent\Factories\Factory;910class ServerFactory extends Factory11{12/**13* The name of the factory's corresponding model.14*15* @var string16*/17protected $model = Server::class;1819/**20* Define the model's default state.21*22* @return array23*/24public function definition()25{26return [27'uuid' => Uuid::uuid4()->toString(),28'uuidShort' => Str::lower(Str::random(8)),29'name' => $this->faker->firstName,30'description' => implode(' ', $this->faker->sentences()),31'skip_scripts' => 0,32'status' => null,33'memory' => 512,34'swap' => 0,35'disk' => 512,36'io' => 500,37'cpu' => 0,38'threads' => null,39'oom_disabled' => 0,40'startup' => '/bin/bash echo "hello world"',41'image' => 'foo/bar:latest',42'allocation_limit' => null,43'database_limit' => null,44'backup_limit' => 0,45'created_at' => Carbon::now(),46'updated_at' => Carbon::now(),47];48}49}505152