Skip to content

Commit

Permalink
feat: Allow base path searching
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraLeigh committed May 9, 2023
1 parent e6d45b4 commit eeb6798
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Support/ClassNameResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ public function resolve(string $fullName): ?string
return $fullName;
}

$basePath = app_path();
// If starts with a slash, we should start from the root of the project
if (str_starts_with($fullName, '/')) {
$basePath = base_path();
$fullName = substr($fullName, 1);
} else {
$basePath = app_path();
}
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basePath), RecursiveIteratorIterator::SELF_FIRST);

$hasNamespace = false;
Expand Down

0 comments on commit eeb6798

Please sign in to comment.