Repository navigation
FLUX-911 - Support Laravel 13 - #14
Merged
Merged
Conversation
Allow laravel/framework ^12.0|^13.0 and laravel-process-stamps ^8.0|^9.0 (process-stamps 9.x is its Laravel 13 line). 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. bootAuditLoggable() now registers the observer through whenBooted(), which runs right after boot on both Laravel 12 and 13. PHPUnit 12 no longer reads @test docblocks, so the tests use #[Test]. CI now runs Laravel 12 and 13 on PHP 8.2 to 8.5 (8.2 on 12 only).
ConfigurableNamespaceTest called MakeModelAuditLogTable::getModelNamespace(), which #11 renamed to generateModelNamespace(). The tests now call the new name. The custom-suffix test asserted a suffix-stripped name for an audit log that sets $auditLoggableModel, which #11 made take precedence. It now checks both paths: an explicit $auditLoggableModel ignores the suffix, and a model without one has the suffix stripped. That second check exposed a bug: getSubjectModelClassname() used str_replace(), which also removed the suffix from namespace segments (AlwaysOpen\AuditLog\...\TagAuditLog with suffix "Log" resolved to AlwaysOpen\Audit\...\TagAudit). It now strips the suffix from the end only.
fico7489/laravel-pivot is unmaintained and has no Laravel 13 release. Composer was quietly falling back to its 3.0.3 from 2019, whose loose constraint happens to allow Laravel 13 but which lacks later fixes such as cancelling pivotAttaching/pivotDetaching. Require the always-open fork instead. It keeps the Fico7489\Laravel\Pivot namespace, so no code changes.
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
10.x(cut from9.x) for Laravel 13.9.xstays on Laravel 11/12.laravel/framework^12.0|^13.0andalways-open/laravel-process-stamps^8.0|^9.0(process-stamps9.xis its Laravel 13 line). 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.fico7489/laravel-pivotis replaced byalways-open/laravel-pivot ^4.0(see Blocked).awobaz/compoships^2.0.3is unchanged, because 2.5.5 already allows Laravel <14.LogicException: … may not be called on model … while it is being bootedwhen a model callsobserve()while it is booting, andobserve()instantiates the model.bootAuditLoggable()now defers registration withstatic::whenBooted(...), which Laravel 12 and 13 both run right after boot. On Laravel 13 the suite had 47 errors before this change; afterwards it matches Laravel 12.#[Test]. PHPUnit 12 no longer reads/** @test */.9.x(see FLUX-839 - Test PHP 8.5 in CI #13) are fixed:ConfigurableNamespaceTest×2 calledgetModelNamespace(). Fix custom namespace audit loggable resolution #11 renamed it togenerateModelNamespace(), and the tests now use that name.BaseModelTest::it_gets_correct_subject_model_classname_with_custom_suffixexpected a suffix-stripped name for an audit log that sets$auditLoggableModel, which Fix custom namespace audit loggable resolution #11 made take precedence. It now checks both paths: an explicit$auditLoggableModelignores the suffix, andTagAuditLog(no explicit model) has the suffix stripped.getSubjectModelClassname()usedstr_replace(), which also removed the suffix from namespace segments.AlwaysOpen\AuditLog\…\TagAuditLogwith suffixLogresolved toAlwaysOpen\Audit\…\TagAudit, a class that doesn't exist. It now usesStr::replaceEnd(). Only audit-log classes that don't set$auditLoggableModeland whose namespace contains the suffix are affected, and those resolved to a missing class before.Local runs (process-stamps
v9.0.0; laravel-pivot from always-open/laravel-pivot#1 via a path repository at 4.0.0;composer update --prefer-stable --with laravel/framework:<v>, thenvendor/bin/phpunit):Unblocked
Needs: published (FLUX-911 - Laravel 13 support as always-open/laravel-pivot 4.x laravel-pivot#1).always-open/laravel-pivotv4.0.0 on Packagistfico7489/laravel-pivotis unmaintained and has no Laravel 13 release, so this PR requires the always-open fork (^4.0), which keeps theFico7489\Laravel\Pivotnamespace (no code changes). CI now resolvesalways-open/laravel-pivot v4.0.0and passes on every leg (54 tests, 136 assertions on Laravel 13.35.0).fico7489/laravel-pivot ^3.0.1: on Laravel 13 Composer quietly picked its 3.0.3 from 2019, whose>5.5.0constraint happens to allow 13 but which lacks later fixes such as cancellingpivotAttaching/pivotDetaching.Needs FLUX-911 - Support Laravel 13 laravel-process-stamps#9: merged and taggedv9.0.0.Release: tag
v10.0.0from10.xonce both are unblocked.Ticket: FLUX-911