Detect Craft 6 as Craft, not Laravel (FR-6088)#15
Merged
frank-laemmer merged 1 commit intoJun 26, 2026
Conversation
Craft 6 is a Laravel-based rewrite, so it requires both laravel/framework and craftcms/cms. LaravelDetector runs first and only defers to a more specific stack when the package is listed in DependencyTree::CHILDREN_STACKS['laravel/framework'] — craftcms/cms was missing, so Craft 6 resolved to Laravel before CraftCMSDetector ran. Mirror the Statamic pattern: expose CraftCMSDetector::PACKAGE_NAME and add it to the Laravel children so LaravelDetector defers and CraftCMSDetector wins. Craft 5 is unaffected (Yii-based, no laravel/framework). Adds a Craft 6 fixture + regression test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖
Craft 6 is a Laravel-based rewrite, so a Craft 6 project requires both
laravel/frameworkandcraftcms/cms.LaravelDetectorruns first and only defers to a more specific detector when the package is listed inDependencyTree::CHILDREN_STACKS['laravel/framework']—craftcms/cmswas missing, so Craft 6 resolved to Laravel beforeCraftCMSDetectorran. (Found while setting up a Craft 6 test app — MR-112.)Fix (mirrors the Statamic pattern):
CraftCMSDetector::PACKAGE_NAME = 'craftcms/cms'and use it inpackagesToSearch().DependencyTree, soLaravelDetectordefers andCraftCMSDetectorwins.Craft 5 is unaffected (Yii-based, no
laravel/framework); the same detector keeps catching it viacraftcms/cms.Tests: added a Craft 6 fixture (
laravel/framework: ^13.8+craftcms/cms: ^6.0.0) →CRAFT_CMS. Full suite green (cs + phpstan + 82 tests). Laravel and Statamic cases unchanged.Closes FR-6088.
🤖