From a233d5bd5a9e4deeeb5e2589a97ba2124919dca4 Mon Sep 17 00:00:00 2001 From: Krot Eval <38257723+4n70w4@users.noreply.github.com> Date: Wed, 22 Apr 2020 07:33:49 +0300 Subject: [PATCH] Ability to use patterns for model_locations (#921) Example: app/Services/*/Models --- src/Console/ModelsCommand.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 7ebe99c..9e4bd48 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -264,9 +264,12 @@ class ModelsCommand extends Command $models = array(); foreach ($this->dirs as $dir) { $dir = base_path() . '/' . $dir; - if (file_exists($dir)) { - foreach (ClassMapGenerator::createMap($dir) as $model => $path) { - $models[] = $model; + $dirs = glob($dir, GLOB_ONLYDIR); + foreach ($dirs as $dir) { + if (file_exists($dir)) { + foreach (ClassMapGenerator::createMap($dir) as $model => $path) { + $models[] = $model; + } } } }