Skip to content

Detect Craft 6 as Craft, not Laravel (FR-6088)#15

Merged
frank-laemmer merged 1 commit into
mainfrom
fr-6088-stack-detector-detect-craft-6-as-craft
Jun 26, 2026
Merged

Detect Craft 6 as Craft, not Laravel (FR-6088)#15
frank-laemmer merged 1 commit into
mainfrom
fr-6088-stack-detector-detect-craft-6-as-craft

Conversation

@frank-laemmer

@frank-laemmer frank-laemmer commented Jun 26, 2026

Copy link
Copy Markdown
Member

🤖

Craft 6 is a Laravel-based rewrite, so a Craft 6 project requires both laravel/framework and craftcms/cms. LaravelDetector runs first and only defers to a more specific detector when the package is listed in DependencyTree::CHILDREN_STACKS['laravel/framework']craftcms/cms was missing, so Craft 6 resolved to Laravel before CraftCMSDetector ran. (Found while setting up a Craft 6 test app — MR-112.)

Fix (mirrors the Statamic pattern):

  • Expose CraftCMSDetector::PACKAGE_NAME = 'craftcms/cms' and use it in packagesToSearch().
  • Add it to the Laravel children in DependencyTree, so LaravelDetector defers and CraftCMSDetector wins.

Craft 5 is unaffected (Yii-based, no laravel/framework); the same detector keeps catching it via craftcms/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.

🤖

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>
@frank-laemmer frank-laemmer requested a review from pheeque1 June 26, 2026 12:01
@frank-laemmer frank-laemmer changed the title Detect Craft 6 (Laravel-based) as Craft, not Laravel (FR-6088) Detect Craft 6 as Craft, not Laravel (FR-6088) Jun 26, 2026

@pheeque1 pheeque1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@frank-laemmer frank-laemmer merged commit 3e30dbb into main Jun 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants