Skip to content

Commit

Permalink
fix factories check in module-seed command caffeinated#370 ..
Browse files Browse the repository at this point in the history
  • Loading branch information
nickurt committed Oct 30, 2018
1 parent 109fc42 commit f4ffe2b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Console/Commands/ModuleSeedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ protected function seed($slug)
$namespacePath = $this->module->getNamespace();
$rootSeeder = $module['basename'].'DatabaseSeeder';
$fullPath = $namespacePath.'\\'.$module['basename'].'\Database\Seeds\\'.$rootSeeder;
$factoriesPath = module_path($slug).DIRECTORY_SEPARATOR.'Database'.DIRECTORY_SEPARATOR.'Factories'.DIRECTORY_SEPARATOR;

if (class_exists($fullPath)) {
if ($this->option('class')) {
Expand All @@ -105,9 +104,7 @@ protected function seed($slug)
$params['--force'] = $option;
}

if (count(glob($factoriesPath.'*.php')) > 0) {
$this->call('db:seed', $params);
}
$this->call('db:seed', $params);

event($slug.'.module.seeded', [$module, $this->option()]);
}
Expand Down

0 comments on commit f4ffe2b

Please sign in to comment.