* // will never return twice the same value * $faker->unique()->randomElement(array(1, 2, 3)); *
* $values = array(); * $evenValidator = function ($digit) { * return $digit % 2 === 0; * }; * for ($i=0; $i < 10; $i++) { * $values []= $faker->valid($evenValidator)->randomDigit; * } * print_r($values); // [0, 4, 8, 4, 2, 6, 0, 8, 8, 6] *