Skip to content

FLUX-911 - Support Laravel 13 - #25

Merged
qschmick merged 1 commit into
7.xfrom
FLUX-911/laravel-13
Oct 10, 2026
Merged

qschmick merged 1 commit into
7.xfrom
FLUX-911/laravel-13

Conversation

@qschmick

@qschmick qschmick commented Oct 8, 2026

Copy link
Copy Markdown
Member

Summary

New major line 7.x (cut from 6.x) for Laravel 13. 6.x stays on Laravel 11/12.

  • Constraints: illuminate/contracts ^12.0|^13.0. Laravel 11 is dropped because Composer refuses every 11.x release over a security advisory. Dev deps: testbench ^10.0|^11.0, phpunit ^11.0|^12.0.
  • Observer fix (behaviour-preserving): Laravel 13 throws LogicException: … may not be called on model … while it is being booted when a model calls observe() while it is booting, and observe() instantiates the model. The Ordered and CascadeUpdate traits called parent::observe() from their boot methods, so on Laravel 13 any model using either trait failed on first instantiation. Both now register their observers with static::whenBooted(...), which Laravel 12 and 13 both run right after boot.
  • New tests (tests/Traits/ObservedTraitsTest.php, plus two fake models) check that a model using each trait gets its observer's listeners, and for Ordered, its OrderedScope. Before the fix they error on Laravel 13. With the Ordered registration removed, the test fails (…OrderedObserver@saving missing).
  • Psalm: Laravel 13 makes Scope generic, so OrderedScope declares @implements Scope<Model>. Psalm reports 0 errors on Laravel 13, which is what the Psalm workflow resolves (composer install with no lockfile). On Laravel 12 the annotation gives 1 error, because Scope isn't generic there.
  • CI / README: the matrix is now Laravel 12/13 on PHP 8.3–8.5, 7.x is added to the trigger branches, and the README's version table lists 7.x.

Local runs (composer update --prefer-stable --with laravel/framework:<v>, then testbench package:test --parallel --no-coverage, which is the composer test script):

PHP Laravel Testbench Result
8.4.23 12.69.3 10.12.0 OK (35 tests, 60 assertions)
8.5.8 12.69.3 10.12.0 OK (35 tests, 60 assertions)
8.4.23 13.35.0 11.3.0 OK (35 tests, 60 assertions)
8.5.8 13.35.0 11.3.0 OK (35 tests, 60 assertions)

Release: tag v7.0.0 from 7.x after merge.

Ticket: FLUX-911

Allow illuminate/contracts ^12.0|^13.0. Laravel 11 is dropped because
Composer refuses every 11.x release over a security advisory. Testbench
moves to ^10.0|^11.0 and PHPUnit to ^11.0|^12.0.

Laravel 13 throws when a model calls observe() while it is booting, and
observe() instantiates the model. The Ordered and CascadeUpdate traits now
register their observers through whenBooted(). New tests check that a model
using each trait gets its observer (and, for Ordered, its scope).

Laravel 13 makes the Scope interface generic, so OrderedScope declares
@implements Scope<Model> for Psalm.

CI runs Laravel 12 and 13 and builds the 7.x branch.
@qschmick
qschmick marked this pull request as ready for review October 10, 2026 01:29
@qschmick
qschmick merged commit d6dfae3 into 7.x Oct 10, 2026
8 checks passed
@qschmick
qschmick deleted the FLUX-911/laravel-13 branch October 10, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant