Skip to content

Add Laravel 13 support#2529

Open
wychoong wants to merge 5 commits into
lunarphp:1.2from
wychoong:add-laravel-13
Open

Add Laravel 13 support#2529
wychoong wants to merge 5 commits into
lunarphp:1.2from
wychoong:add-laravel-13

Conversation

@wychoong

Copy link
Copy Markdown
Contributor

What changed

Dependency constraints (composer.json, packages/core/composer.json)

  • Added ^13.0 to laravel/framework version constraint
  • Added ^7.0.0 to kalnoy/nestedset — v7 is the release that explicitly targets Laravel 13; v6 is retained for L11/L12 installs
  • Removed doctrine/dbal as a direct dependency — Lunar never used it directly; the sole usage was a bridge API removed in Laravel 11
  • Added ^11.0 to orchestra/testbench in dev dependencies

MigrateGetCandy command (packages/core/src/Console/Commands/MigrateGetCandy.php)

  • Replaced DB::connection()->getDoctrineSchemaManager()->listTableNames() with Schema::getTableListing(), which is the Laravel 11+ native equivalent. The old call relied on the Doctrine DBAL bridge that was dropped in Laravel 11, meaning it was already broken on all currently supported versions.

CI (.github/workflows/tests.yml)

  • Added 13.* to the Laravel test matrix with testbench: 11.*
  • Excluded PHP 8.2 + Laravel 13 (consistent with existing PHP 8.2 exclusions)

Remaining blocker

cartalyst/converter has no Laravel 13-compatible release. The package versions lock-step with illuminate/* — v9 supports L11, v10 supports L12, and no v11 exists yet for L13. Until upstream releases a v11, Lunar cannot fully resolve on Laravel 13. This needs to be tracked and the constraint updated (^9.0|^10|^11) once the release lands.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-project-automation github-project-automation Bot moved this to Todo in Roadmap Jun 29, 2026
@glennjacobs glennjacobs marked this pull request as draft June 29, 2026 13:31
@glennjacobs

Copy link
Copy Markdown
Contributor

@wychoong changed to draft whilst still WIP.

In v2 I've removed cartalyst/converter, possible we could port that I guess.

@glennjacobs

Copy link
Copy Markdown
Contributor

@wychoong wychoong changed the base branch from 1.x to 1.2 June 29, 2026 13:36
@wychoong

wychoong commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@wychoong changed to draft whilst still WIP.

In v2 I've removed cartalyst/converter, possible we could port that I guess.

claude targeted to the wrong branch to merge

I wanted to target 1.2, max 1.4. 1.5 already support L13 and removed cartalyst/converter
so likely have to fork it publish with the original namespace instead of porting the package (no BC)

@glennjacobs

Copy link
Copy Markdown
Contributor

What is the purpose of this PR? We are on v1.3 now and soon to be 1.5, so I don't know why we're targeting 1.2

@wychoong

Copy link
Copy Markdown
Contributor Author

why we're targeting 1.2

because only 1.2 can be targeted, 1.x is 1.5
ideally is 1.3

@glennjacobs

Copy link
Copy Markdown
Contributor

why we're targeting 1.2

because only 1.2 can be targeted, 1.x is 1.5 ideally is 1.3

Oh, following now.

We should look to use the 1.4 branch.

@glennjacobs

Copy link
Copy Markdown
Contributor

@wychoong are you still intending to update this PR?

@wychoong

wychoong commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@wychoong are you still intending to update this PR?

the only open item should be cartalyst/converter and what do you suggest for this? fork under lunar? or backport MeasurementConverter from 1.5?

@glennjacobs

Copy link
Copy Markdown
Contributor

@wychoong are you still intending to update this PR?

the only open item should be cartalyst/converter and what do you suggest for this? fork under lunar? or backport MeasurementConverter from 1.5?

Certainly don't want to fork it, so probably backport.

wychoong and others added 2 commits July 4, 2026 14:33
Backports Lunar\Utils\MeasurementConverter, the Lunar\Facades\Converter
facade and its unit tests from upstream lunarphp/lunar 1.x (10b1210,
'Update to L13 lunarphp#2436'), and removes the cartalyst/converter dependency
from the root and core composer.json.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace cartalyst/converter with backported MeasurementConverter
@wychoong

wychoong commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Upgrade guide

Measurement converter replaces cartalyst/converter

Lunar now ships its own measurement converter and no longer depends on
cartalyst/converter.

No action needed if you only define measurements in
config/lunar/shipping.php and use the model dimension attributes
($variant->length->to('length.m')->convert()->getValue()) — the API and
config format are identical.

Update your code if you:

  1. Import the Cartalyst facade — replace:
   use Cartalyst\Converter\Laravel\Facades\Converter;
   with:
   use Lunar\Facades\Converter;
  1. Type-hint or instanceof-check the converter — replace
    Cartalyst\Converter\Converter with Lunar\Utils\MeasurementConverter.
  2. Register Cartalyst\Converter\Laravel\ConverterServiceProvider anywhere
    (e.g. your test suite) — remove it; Lunar registers its converter
    automatically.
  3. Use Cartalyst's currency conversion or exchangers — these are not
    supported by the new converter. Require cartalyst/converter in your
    own composer.json if you still need them.

wychoong and others added 2 commits July 4, 2026 15:00
pest-plugin-laravel ^3 caps laravel/framework at ^12, so the L13 CI
matrix cells could not resolve dependencies. Pest 4 / plugin 4 support
Laravel 13 and the suites pass unchanged under PHPUnit 12.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Allow pest 4 for Laravel 13 test matrix
@wychoong wychoong marked this pull request as ready for review July 4, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants