Skip to content

Commit

Permalink
ensure class_exists for both Capital and lower case namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
dcblogdev committed Mar 19, 2024
1 parent c025b58 commit e7c4959
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Commands/Database/SeedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public function moduleSeed(Module $module)
$seeders = [];
$name = $module->getName();
$config = $module->get('migration');

if (is_array($config) && array_key_exists('seeds', $config)) {
foreach ((array)$config['seeds'] as $class) {
if (class_exists($class)) {
Expand All @@ -109,6 +110,9 @@ public function moduleSeed(Module $module)
}
} else {
$class = $this->getSeederName($name); //legacy support

$class = implode('\\', array_map('ucwords', explode('\\', $class)));

if (class_exists($class)) {
$seeders[] = $class;
} else {
Expand Down

0 comments on commit e7c4959

Please sign in to comment.