Skip to content

Commit eb89128

Browse files
authored
Merge pull request #26 from mmagdiel/fix/pass_array_as_parameter_on_seed_method
add fix on seed method
2 parents cdd0cbb + 0e802ba commit eb89128

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Schema.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,12 @@ public static function seed(string $fileToSeed): bool
317317

318318
if (strpos($fakerMethod, ':') !== false) {
319319
$fakerMethod = explode(':', $fakerMethod);
320-
$localFakerInstance = $localFakerInstance->{$fakerMethod[0]}($fakerMethod[1]);
320+
if (strpos($fakerMethod[1], ',') !== false) {
321+
$array_params = explode(",",$fakerMethod[1]);
322+
$localFakerInstance = $localFakerInstance->{$fakerMethod[0]}($array_params);
323+
} else {
324+
$localFakerInstance = $localFakerInstance->{$fakerMethod[0]}($fakerMethod[1]);
325+
}
321326
} else {
322327
$localFakerInstance = $localFakerInstance->{$fakerMethod}();
323328
}

0 commit comments

Comments
 (0)