Ability to use patterns for model_locations (#921)

Example: app/Services/*/Models
This commit is contained in:
Krot Eval
2020-04-22 06:33:49 +02:00
committed by GitHub
parent cfa9a81d65
commit a233d5bd5a
+3
View File
@@ -264,12 +264,15 @@ class ModelsCommand extends Command
$models = array(); $models = array();
foreach ($this->dirs as $dir) { foreach ($this->dirs as $dir) {
$dir = base_path() . '/' . $dir; $dir = base_path() . '/' . $dir;
$dirs = glob($dir, GLOB_ONLYDIR);
foreach ($dirs as $dir) {
if (file_exists($dir)) { if (file_exists($dir)) {
foreach (ClassMapGenerator::createMap($dir) as $model => $path) { foreach (ClassMapGenerator::createMap($dir) as $model => $path) {
$models[] = $model; $models[] = $model;
} }
} }
} }
}
return $models; return $models;
} }