ServerFactory.php 767 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Database\Factories;
  3. use App\Models\Product;
  4. use App\Models\Server;
  5. use Illuminate\Database\Eloquent\Factories\Factory;
  6. use Illuminate\Support\Str;
  7. class ServerFactory extends Factory
  8. {
  9. /**
  10. * The name of the factory's corresponding model.
  11. *
  12. * @var string
  13. */
  14. protected $model = Server::class;
  15. /**
  16. * Define the model's default state.
  17. *
  18. * @return array
  19. */
  20. public function definition()
  21. {
  22. return [
  23. 'name' => $this->faker->name,
  24. 'description' => $this->faker->text(60),
  25. 'identifier' => Str::random(30),
  26. 'pterodactyl_id' => $this->faker->numberBetween(1000000,1000000000),
  27. 'product_id' => Product::factory()
  28. ];
  29. }
  30. }