Repository navigation
FLUX-911 - Support Laravel 13 - #25
Merged
Merged
Conversation
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.
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.
Summary
New major line
7.x(cut from6.x) for Laravel 13.6.xstays on Laravel 11/12.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.LogicException: … may not be called on model … while it is being bootedwhen a model callsobserve()while it is booting, andobserve()instantiates the model. TheOrderedandCascadeUpdatetraits calledparent::observe()from their boot methods, so on Laravel 13 any model using either trait failed on first instantiation. Both now register their observers withstatic::whenBooted(...), which Laravel 12 and 13 both run right after boot.tests/Traits/ObservedTraitsTest.php, plus two fake models) check that a model using each trait gets its observer's listeners, and forOrdered, itsOrderedScope. Before the fix they error on Laravel 13. With theOrderedregistration removed, the test fails (…OrderedObserver@savingmissing).Scopegeneric, soOrderedScopedeclares@implements Scope<Model>. Psalm reports 0 errors on Laravel 13, which is what the Psalm workflow resolves (composer installwith no lockfile). On Laravel 12 the annotation gives 1 error, becauseScopeisn't generic there.7.xis added to the trigger branches, and the README's version table lists7.x.Local runs (
composer update --prefer-stable --with laravel/framework:<v>, thentestbench package:test --parallel --no-coverage, which is thecomposer testscript):Release: tag
v7.0.0from7.xafter merge.Ticket: FLUX-911