Skip to content

[5.x] Updated AddonServiceProvider::shouldBootRootItems() to support trailing slashes #11861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Providers/AddonServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,8 @@ private function shouldBootRootItems()
// i.e. It's the "root" provider. If it's in a subdirectory maybe the developer
// is organizing their providers. Things like tags etc. can be autoloaded but
// root level things like routes, views, config, blueprints, etc. will not.
$thisDir = Path::tidy(dirname((new \ReflectionClass(static::class))->getFileName()));
$autoloadDir = $addon->directory().$addon->autoload();
$thisDir = Str::ensureRight(Path::tidy(dirname((new \ReflectionClass(static::class))->getFileName())), '/');
$autoloadDir = Str::ensureRight($addon->directory().$addon->autoload(), '/');

return $thisDir === $autoloadDir;
}
Expand Down