Skip to content

Commit

Permalink
make sure we only search classes under /models/ path
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Dec 29, 2024
1 parent 7ee9cd1 commit b08f44f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/system/helpers/ModelFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, '\\');
Expand Down

0 comments on commit b08f44f

Please sign in to comment.