1

I use Faker for the first time with Laravel. I can not find anywhere to solve my problem.

2D "," 3D "or" common "with 20% chance for" web "," 2D "," 3D "and 40% For "common".

Is it possible to do this with Faker?

Thank you

Jeremy
  • 1,756
  • 3
  • 21
  • 45

1 Answers1

2

Use the randomElement method:

$faker->randomElement(['a', 'b', 'c', 'd']);
Joseph Silber
  • 214,931
  • 59
  • 362
  • 292