Skip to content

Commit 80f8ed3

Browse files
committed
filter folder
1 parent f3e85ae commit 80f8ed3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Commands/Traits/GatherModels.php

+11
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ public function gatherModels($filterModels = null, ?string $modelsPath = null):
2424
if ($file === '.' || $file === '..') {
2525
continue;
2626
}
27+
// Full path to the file
28+
$filePath = $modelsDirectory . $file;
29+
// Check if it's a file, not a directory
30+
// ALX :: we don't need to check if it's a file on .php
31+
// if (!is_file($filePath)) {
32+
// continue;
33+
// }
34+
// Optionally, ensure the file has a .php extension
35+
if (pathinfo($filePath, PATHINFO_EXTENSION) !== 'php') {
36+
continue;
37+
}
2738
$modelName = pathinfo($file, PATHINFO_FILENAME);
2839
if ($filterModels !== null && ! in_array($modelName, $filterModels)) {
2940
continue;

0 commit comments

Comments
 (0)