Fix model factory method arguments for Laravel >= 9 (#1361)

This commit is contained in:
Wim Reckman
2022-08-11 12:32:14 +02:00
committed by GitHub
parent 6e26f22c76
commit 5eadd2c7de
5 changed files with 125 additions and 4 deletions
+5 -1
View File
@@ -1250,7 +1250,11 @@ class ModelsCommand extends Command
return;
}
$this->setMethod('factory', $factory, ['...$parameters']);
if (version_compare($this->laravel->version(), '9', '>=')) {
$this->setMethod('factory', $factory, ['$count = null, $state = []']);
} else {
$this->setMethod('factory', $factory, ['...$parameters']);
}
}
/**