Comment obtenir un élément aléatoire à partir d'un tableau donné via PHP Faker à Laravel
use Faker\Factory;
$faker = Factory::create();
// Returns a random element from the given array.
echo $faker->randomElements(['a', 'b', 'c', 'd', 'e']);
// 'c'
Oebsolutions