Skip to content

Support Laravel 13#228

Open
austinderrick wants to merge 1 commit into
wintercms:wip/1.3from
austinderrick:wip/1.3-laravel-13
Open

Support Laravel 13#228
austinderrick wants to merge 1 commit into
wintercms:wip/1.3from
austinderrick:wip/1.3-laravel-13

Conversation

@austinderrick
Copy link
Copy Markdown

@austinderrick austinderrick commented Jun 1, 2026

Builds on #207 (Laravel 12 support), continuing the 1.3 development line. This PR adds Laravel 13 support on top of the Laravel 12 work.

Required by wintercms/winter#1487 (WinterCMS Laravel 13 support).

Summary

Targets Laravel 13 (released 2026-03-17). Storm re-implements/overrides a number of framework internals, so this covers the framework-level deltas in addition to the dependency bumps.

Dependency changes (composer.json)

  • php ^8.2^8.3 (Laravel 13 minimum)
  • laravel/framework ^12.30.1^13.0
  • laravel/tinker ^2.8.1^3.0
  • nesbot/carbon ^3.0^3.8.4
  • symfony/console, symfony/process, symfony/yaml^7.4|^8.0
  • orchestra/testbench ^10.0^11.0
  • phpunit/phpunit ^11.0^11.5.50 (Laravel 13 + testbench 11 accept PHPUnit 11.5.50; kept on 11.x because meyfa/phpunit-assert-gd and dms/phpunit-arraysubset-asserts do not yet support PHPUnit 12)

Code changes

  • ArraySource trait — Laravel 13 throws a LogicException when a model is instantiated while it is still booting. bootArraySource() previously did new static (and static::insert(), which also instantiates) during boot. The datasource setup is now deferred and performed lazily on the first resolveConnection() call, by which point the model has finished booting.
  • Relation classes (HasOne, HasMany, HasOneThrough, HasManyThrough, BelongsTo, MorphTo, MorphOne, BelongsToMany, MorphToMany) — added @template/@extends generics mirroring Laravel 13's relation generics so the Builder<TRelatedModel> passed by HasRelationships matches the relation constructors (fixes PHPStan covariance errors).
  • Foundation/Console/DownCommandoption('status', 503) passed an unsupported 2nd argument to Command::option(); the default is already defined by the parent down command, so the stray argument was removed.
  • Auth/Models/Preferences::findRecord() — corrected the scope typing so it returns self|null rather than stdClass|null.
  • tests/Scheduling/ScheduleListCommandTest — updated the expected schedule:list output for an invokable class passed to ->call() (modern Laravel renders the bare class name, without the Closure at: prefix).
  • phpstan-baseline.neon — removed now-stale entries for errors that no longer occur on Laravel 13.

CI

  • tests.yml matrix: dropped PHP 8.2 → ['8.3', '8.4']
  • code-analysis.yaml / code-quality.yaml: PHP 8.28.3

Testing

  • composer test (PHPUnit): green (711 tests, 0 failures, 0 errors)
  • composer analyze (PHPStan level 5): 0 errors
  • composer sniff (PHPCS): clean

Related WinterCMS Laravel 13 PRs

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: af8fc946-15f0-4718-a55b-76f21f4bfeef

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR upgrades Winter CMS Storm to require PHP 8.3 minimum, updates CI workflows and composer dependencies to match, refines PHPDoc type annotations to document Eloquent Builder generics consistently across Preferences and relation factories, implements lazy initialization for ArraySource SQLite connections to defer boot until first use, adjusts DownCommand payload generation logic, removes four now-resolved PHPStan baseline suppressions, and updates test expectations for scheduled call output formatting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Support Laravel 13' directly and clearly summarizes the main objective of the pull request, which is to add Laravel 13 compatibility.
Docstring Coverage ✅ Passed Docstring coverage is 88.24% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@austinderrick
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Builds on the Laravel 12 work (wintercms#207). Bumps to laravel/framework ^13,
PHP ^8.3, tinker ^3, carbon ^3.8.4, symfony ^7.4|^8.0, testbench ^11
(PHPUnit kept at ^11.5.50 pending phpunit 12 support in test helpers).

Code: defer ArraySource datasource setup out of the model boot cycle
(L13 forbids instantiating a model while booting); restate Builder<Model>
param on HasRelationships relation factories; fix Preferences::findRecord()
scope typing; drop the unsupported 2nd arg to DownCommand option('status');
update schedule:list invokable-class test expectation; prune stale phpstan
baseline entries; CI matrices to PHP 8.3/8.4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant