Repository navigation
Support Laravel 13 - #1487
Support Laravel 13#1487austinderrick wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis pull request upgrades Winter CMS to PHP 8.3 and Laravel 13. CI workflows update PHP versions in setup steps and test matrices. Composer manifests across the root project and system, backend, and CMS modules raise PHP requirements from ^8.2 to ^8.3 and Laravel from ^12.0 to ^13.0. Winter module dependencies shift to dev-wip/1.3-laravel-13 branches with repository configurations updated accordingly. Additionally, VersionManager refactors getCurrentVersionNote() to use the Arr::last utility with a type predicate for selecting comment history entries. Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
f24ee4f to
c9c1ba4
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
c9c1ba4 to
fd343e6
Compare
Move Winter to Laravel 13 (PHP 8.3+): bump the framework and PHPUnit constraints in the root and module manifests, use Arr::last() in VersionManager, resolve Storm and the modules from the Laravel 13 branches until wintercms/storm#228 merges, and update the CI matrix.
3507353 to
6f0eb77
Compare
Depends on wintercms/storm#228 (Storm Laravel 13 support). Until that PR merges, this PR resolves Storm and the three modules through temporary Composer entries. See "Before merging" below.
Builds on #1366 (Laravel 12 support) and moves Winter CMS 1.3 to Laravel 13.
Summary
Laravel 13 was released on 2026-03-17 and requires PHP 8.3. Most of this PR is dependency and CI changes. There is one module code change.
Code change
modules/system/classes/VersionManager.php:array_last(array_where(...))is nowArr::last($histories, fn). Storm no longer defines the globalarray_last()helper, andsymfony/polyfill-php85defines a nativearray_last()that takes a single argument, so the old call would break.Dependency changes
composer.json:php^8.2→^8.3;laravel/framework^12.0→^13.0;phpunit/phpunit^11.0→^11.5.50. Laravel 13 and Testbench 11 need at least PHPUnit 11.5.50. PHPUnit stays on 11.x becausedms/phpunit-arraysubset-assertsandmeyfa/phpunit-assert-gdhave no PHPUnit 12 release yet.modules/{system,backend,cms}/composer.json: the samephpandlaravel/frameworkchanges.winter/stormrequiresdev-wip/1.3-laravel-13 as 1.3, from a VCS repository foraustinderrick/storm.dev-wip/1.3-laravel-13, frompathrepositories that point at the in-repomodules/directories. The published split packages still require Laravel 12. Composer reports "Source already present", and the CI "Reset modules" step keeps the committed modules."no-api": true, so Composer clones them with plain git. CI for pull requests from forks has no GitHub API token.CI
tests.yml: the PHP matrix drops 8.2 and is now['8.3', '8.4', '8.5']. The JavaScript job moves from PHP 8.2 to 8.3.code-quality.yaml: PHP8.2→8.3.Before merging
composer.json, changewinter/stormback todev-wip/1.3 as 1.3and the three modules back todev-wip/1.3.austinderrick/stormVCS repository and the threepathrepositories. Keep thepieterocp/phpunit-arraysubset-assertsrepository.If these entries merge, every install of
wip/1.3resolves Storm from a personal fork, and projects created from Winter resolve the core modules from their ownmodules/directory, socomposer updatenever pulls module updates. After this PR merges, the subsplit workflow publishes the Laravel 13 module manifests, so thepathrepositories are no longer needed.Breaking changes
These are the breaking changes surfaced while upgrading WinterCMS (and a real downstream app) to Laravel 13. Plugin and theme authors should review these.
PHP 8.3 minimum
Laravel 13 requires PHP 8.3+ (the 1.3 / Laravel 12 line allowed 8.2). CI matrices drop 8.2.
Models may not be instantiated while booting (
LogicException)Laravel 13 throws
LogicException: The [Model::bootIfNotBooted] method may not be called on model [X] while it is being bootedwhen a model is instantiated during its own boot — i.e.new static,new self,(new self()),self::instance(), or anything that constructs the model (includingstatic::insert()/static::query()) inside that model'sboot()or a trait'sboot<TraitName>()method.ArraySourcetrait was affected — fixed in Support Laravel 13 storm#228 (datasource setup deferred to first connection resolution).static::extend(fn ($model) => ...)(runs per instance after construction) or a deferredbootedevent. (In a real downstream app this hit several model traits that did(new self())->hasRelation(...)/self::instance()validation inboot<Trait>().)Laravel Debugbar 4 required (Winter.Debugbar)
Laravel 13 requires
barryvdh/laravel-debugbar ^4, a significant break for anything integrating with it — fixed for the plugin in wintercms/wn-debugbar-plugin#27:Barryvdh\Debugbar\*→Fruitcake\LaravelDebugbar\*(the Composer package name staysbarryvdh/laravel-debugbar). Any code usingBarryvdh\Debugbar\Facades\Debugbar,Barryvdh\Debugbar\LaravelDebugbar,Barryvdh\Debugbar\DataCollector\*, etc. must switch toFruitcake\LaravelDebugbar\....Barryvdh\Debugbar\SymfonyHttpDriverremoved (v4 configures its ownLaravelHttpDriver).LaravelDebugbar::__construct()now requires(Application $app, Request $request)— resolve via the container, notnew LaravelDebugbar($app).DataCollectorInterfaceis now typed:collect(): array,getName(): string,getWidgets(): array. Custom collectors must add these return types.formatDuration()convenience method was removed from php-debugbar'sDataCollectorbase; use$this->getDataFormatter()->formatDuration().DebugBar\Bridge\TwigProfileCollector/NamespacedTwigProfileCollector); guard withclass_exists().Storm container
logaliasStorm aliased the
'log'service toIlluminate\Log\Logger, but'log'is aLogManager. Laravel 13 (and Laravel Debugbar 4's log collector, which type-hintsIlluminate\Log\Logger) expose this — resolvingIlluminate\Log\Loggerreturned aLogManager, throwing aTypeError. Fixed in wintercms/storm#228 to alias'log'toIlluminate\Log\LogManager(matching Laravel core), soIlluminate\Log\Loggerautowires to a realLogger.General Laravel 13 changes
Also review the upstream Laravel 12 → 13 upgrade guide: CSRF middleware renamed
VerifyCsrfToken→PreventRequestForgery(deprecated aliases kept);symfony/polyfill-php85now defines globalarray_first()/array_last()(single-arg — preferWinter\Storm\Support\Arr::first()/Arr::last()); Bootstrap pagination view names renamed;down --with-secrethandling.Testing
CI passes on this branch (Ubuntu and Windows, PHP 8.3, 8.4 and 8.5), running against the Storm branch from wintercms/storm#228:
system: 323 tests, 0 failures, 29 skippedbackend: 250 tests, 0 failurescms: 219 tests, 0 failuresRelated Winter CMS Laravel 13 PRs