diff --git a/modules/system/helpers/ModelFinder.php b/modules/system/helpers/ModelFinder.php index a3643f0f0..d9dc0950f 100644 --- a/modules/system/helpers/ModelFinder.php +++ b/modules/system/helpers/ModelFinder.php @@ -26,7 +26,7 @@ public static function findModuleModels(): array { $modulesPath = base_path() . '/modules'; - $models = collect(Finder::create()->in($modulesPath)->notPath('/tests/')->files()->name('/^[A-Z]{1}.+\.php$/')) + $models = collect(Finder::create()->in($modulesPath)->path('/models/')->notPath('/tests/')->files()->name('/^[A-Z]{1}.+\.php$/')) ->map(function ($model) use ($modulesPath) { $modelPath = str_replace(['/', '.php'], ['\\', ''], Str::after($model->getRealPath(), realpath($modulesPath).DIRECTORY_SEPARATOR)); return ucwords($modelPath, '\\');