DiscordUserFactory.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace Database\Factories;
  3. use App\Models\DiscordUser;
  4. use App\Models\User;
  5. use Illuminate\Database\Eloquent\Factories\Factory;
  6. use Illuminate\Support\Str;
  7. class DiscordUserFactory extends Factory
  8. {
  9. /**
  10. * The name of the factory's corresponding model.
  11. *
  12. * @var string
  13. */
  14. protected $model = DiscordUser::class;
  15. /**
  16. * Define the model's default state.
  17. *
  18. * @return array
  19. */
  20. public function definition()
  21. {
  22. return [
  23. 'id' => $this->faker->numberBetween(186902438396035072 , 986902438396035072),
  24. 'user_id' => function () {
  25. return User::factory()->create()->id;
  26. },
  27. 'username' => $this->faker->userName,
  28. 'avatar' => $this->faker->uuid,
  29. 'discriminator' => $this->faker->randomNumber(4),
  30. 'email' => $this->faker->safeEmail,
  31. 'verified' => $this->faker->boolean,
  32. 'public_flags' => $this->faker->randomNumber(1),
  33. 'locale' => Str::random(2),
  34. 'mfa_enabled' => $this->faker->boolean,
  35. 'premium_type' => $this->faker->randomNumber(1),
  36. ];
  37. }
  38. }