Path: blob/1.0-develop/database/Factories/EggVariableFactory.php
7458 views
<?php12namespace Database\Factories;34use Illuminate\Support\Str;5use Pterodactyl\Models\EggVariable;6use Illuminate\Database\Eloquent\Factories\Factory;78class EggVariableFactory extends Factory9{10/**11* The name of the factory's corresponding model.12*13* @var string14*/15protected $model = EggVariable::class;1617/**18* Define the model's default state.19*/20public function definition(): array21{22return [23'name' => $this->faker->unique()->firstName,24'description' => $this->faker->sentence(),25'env_variable' => Str::upper(Str::replaceArray(' ', ['_'], $this->faker->words(2, true))),26'default_value' => $this->faker->colorName,27'user_viewable' => 0,28'user_editable' => 0,29'rules' => 'required|string',30];31}3233/**34* Indicate that the egg variable is viewable.35*/36public function viewable(): static37{38return $this->state(function (array $attributes) {39return [40'user_viewable' => 1,41];42});43}4445/**46* Indicate that the egg variable is editable.47*/48public function editable(): static49{50return $this->state(function (array $attributes) {51return [52'user_editable' => 1,53];54});55}56}575859