$faker->numbersThatEquatesTo(100)
array:6 [
0 => 6
1 => 80
2 => 5
3 => 7
4 => 1
5 => 1
]
array:6 [
0 => 72
1 => 20
2 => 4
3 => 2
4 => 1
5 => 1
]
array:3 [
0 => 78
1 => 20
2 => 2
]
If you already have a set of numbers that you want to be included, then you may pass them as the second argument in an array.
$faker->numbersThatEquatesTo(100, [0, 2, 4])
return examples with second parameter:
array:7 [
0 => 0
1 => 2
2 => 4
3 => 69
4 => 15
5 => 9
6 => 1
]
array:10 [
0 => 0
1 => 2
2 => 4
3 => 36
4 => 37
5 => 6
6 => 5
7 => 7
8 => 2
9 => 1
]
array:9 [
0 => 0
1 => 2
2 => 4
3 => 8
4 => 55
5 => 18
6 => 4
7 => 8
8 => 1
]
I decided to add a min/max options.
$faker->numbersThatEquatesTo(10, [], 1, 2)
array:6 [
0 => 2
1 => 2
2 => 2
3 => 1
4 => 2
5 => 1
]
$faker->numbersThatEquatesTo(30, [], 1, 6)
array:8 [
0 => 4
1 => 2
2 => 6
3 => 4
4 => 4
5 => 3
6 => 5
7 => 2
]