Skip to content

Commit

Permalink
Merge pull request #70 from LeMatosDeFuk/52-schematics-finds-migratio…
Browse files Browse the repository at this point in the history
…ns-but-not-models

namespace fix
  • Loading branch information
mtolhuys authored Sep 16, 2021
2 parents 8311420 + 8a932be commit b2509ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Services/ModelMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ModelMapper extends ClassReader
public static function map(): array
{
$paths = config('schematics.model.paths', [app_path()]);
$namespace = config('schematics.model.namespace', 'App\\');

foreach ($paths as $path) {
$files = new RecursiveIteratorIterator(
Expand All @@ -30,8 +31,8 @@ public static function map(): array
if (self::readablePhp($file)) {
$class = self::getClassName($file);

if (is_subclass_of($class, Model::class)) {
self::$models[] = $class;
if (is_subclass_of($namespace . $class, Model::class)) {
self::$models[] = $namespace . $class;
}
}
}
Expand Down

0 comments on commit b2509ab

Please sign in to comment.