Skip to content

Added Laravel 13 support - #61

Open
rfpdl wants to merge 4 commits into
lucidarch:mainfrom
rfpdl:feature/laravel-13-support
Open

rfpdl wants to merge 4 commits into
lucidarch:mainfrom
rfpdl:feature/laravel-13-support

Conversation

@rfpdl

@rfpdl rfpdl commented Sep 1, 2026

Copy link
Copy Markdown

Laravel 13 requires symfony/console: ^7.4 || ^8.0, and a stock Laravel 13 app on PHP 8.4+ resolves Symfony 8.1. Lucid caps Symfony at ^7.0, so it cannot be installed alongside it:

$ composer require lucidarch/lucid
  lucidarch/lucid dev-main requires symfony/console ^5.4|^6.0|^7.0 -> found
  symfony/console[...v7.4.17] but the package is fixed to v8.1.5 (lock file
  version) by a partial update

Adding -W makes it "work" by downgrading the host application's symfony/console, symfony/process and symfony/finder from 8.1.5 back to 7.4.17.

Widening the constraint alone isn't enough

Lucid also fatals on Symfony 8, which made two breaking changes it relies on:

  • Command::configure() gained a : void return type
  • Application::add() was removed in favour of addCommand()

Both are new in Symfony 8 — 6.4 and 7.4 are unaffected, so this isn't a latent bug surfacing.

PHP Fatal error: Declaration of Lucid\Console\Commands\FeatureMakeCommand::configure()
must be compatible with Symfony\Component\Console\Command\Command::configure(): void

The change

Three lines, plus CI and docs:

  1. composer.json — the four symfony/* constraints go from ^5.4|^6.0|^7.0 to ^5.4|^6.0|^7.0|^8.0
  2. src/Console/Command.php — configure() becomes configure(): void
  3. lucid — array_walk($commands, [$app, 'add']) becomes $app->addCommands($commands)

addCommands() exists in every supported Symfony major (5.4 through 8.1) and delegates to addCommand() on 8.x, so no version branching is needed. Adding the : void return type is a legal narrowing on 5.4/6.4/7.4, where the parent declares none.

Commits are ordered so the code support lands before the constraint — otherwise there's a commit where Symfony 8 is installable but unsupported.

php stays at ^8.1

Symfony 8 requires PHP >= 8.4.1, so PHP 8.1 through 8.3 hosts resolve Symfony 7.4 or lower on their own. Requiring ^8.0 alone would break Laravel 13 users on PHP 8.3 and drop Laravel 9 through 12 entirely. Laravel itself accepts ^7.4 || ^8.0 for the same reason.

Verification

Installed and ran bin/test-commands.sh against real apps:

  • Laravel 13.29.0 on PHP 8.4 resolves Symfony 8.1.6 — passes
  • Laravel 13.29.0 on PHP 8.3 resolves Symfony 7.4.18 — passes
  • Laravel 12 on PHP 8.5 resolves Symfony 7.4.17 — passes
  • Laravel 9.21.0 on PHP 8.1 with --prefer-lowest resolves Symfony 6.0.2 — passes

composer require lucidarch/lucid into a stock Laravel 13 app now succeeds without -W, and composer show symfony/console still reports v8.x afterwards, so the host is no longer downgraded.

CI

Adds a 13.x axis, excluding PHP 8.1 and 8.2 which Laravel 13 doesn't support.

Two include: cells pin the resolved Symfony major (PHP 8.3 to 7, PHP 8.4 to 8) so a future resolution change can't silently drop one of the two paths this PR supports.

The Lucid require step deliberately has no -W: if the constraint is ever too narrow for the host's Symfony, that step should fail loudly rather than quietly downgrade the host, which is the bug being fixed here.

No new public concepts, no version branches, and backwards compatible with Laravel 9 through 12.

🤖 Generated with Claude Code

Roy Francis Ponce de Leon and others added 4 commits August 31, 2026 17:08
Symfony 8 made two breaking changes that Lucid uses:

  Command::configure()  gained a `: void` return type
  Application::add()    removed in favour of addCommand()

Adding the return type is a legal narrowing on 5.4/6.4/7.4, where the parent
declares none. `addCommands()` exists in every supported major and delegates
to `addCommand()` on 8.x, so no version branch is needed.

This lands before the constraint change so that no commit leaves a state
where Symfony 8 is installable but unsupported.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Laravel 13 requires symfony/console ^7.4 || ^8.0 and resolves Symfony 8.1 on
PHP 8.4+. Capping at ^7.0 meant `composer require lucidarch/lucid` failed on
a stock Laravel 13 app, and forcing it with -W downgraded the host
application's Symfony from 8.1 to 7.4.

php stays at ^8.1. Symfony 8 requires PHP >= 8.4.1, so PHP 8.1-8.3 hosts
resolve Symfony <= 7.4 on their own; raising the floor would drop Laravel
9/10 consumers for no benefit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds a 13.x axis and excludes PHP 8.1/8.2, which Laravel 13 does not support.

Two include cells pin the resolved Symfony major: PHP 8.3 can only reach
Symfony 7 (8 requires PHP >= 8.4.1) and PHP 8.4 reaches Symfony 8. Both paths
must keep working, so a resolution change that silently drops one now fails
the build.

The Lucid require step deliberately omits -W. If the constraint is ever too
narrow for the host's resolved Symfony, that require must fail loudly rather
than quietly downgrade the host.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@rfpdl rfpdl changed the title Feature/laravel 13 support Added Laravel 13 support Sep 1, 2026
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.

1 participant