Skip to content

feat: Add Laravel 13 support#724

Merged
binaryk merged 3 commits into10.xfrom
laravel-13-support
Mar 30, 2026
Merged

feat: Add Laravel 13 support#724
binaryk merged 3 commits into10.xfrom
laravel-13-support

Conversation

@binaryk
Copy link
Copy Markdown
Collaborator

@binaryk binaryk commented Mar 30, 2026

Summary

  • Composer constraints: Updated laravel/framework, illuminate/contracts, laravel/mcp, orchestra/testbench, and openai-php/laravel to support Laravel 13
  • CI matrix: Added Laravel 13 (testbench: 11.*) to the GitHub Actions test matrix
  • Breaking change fix: Replaced static::observe() with direct event listener registration in the HasActionLogs trait to avoid a recursive model boot issue introduced in Laravel 13

Breaking change detail

Laravel 13's Model::observe() now calls new static internally (source), which triggers bootIfNotBooted() on the same model class that is already mid-boot. This causes a LogicException:

The [Illuminate\Database\Eloquent\Model::bootIfNotBooted] method may not be called
on model [App\Models\Post] while it is being booted.

The fix registers created, updating, and deleted listeners directly instead of going through observe(), avoiding the recursive instantiation.

Version matrix

Laravel Testbench PHP
13.* 11.* 8.4, 8.5
12.* 10.* 8.3, 8.4, 8.5
11.* 9.* 8.3, 8.4

Test plan

  • All 415 tests pass on Laravel 13.2.0 + PHP 8.5 + testbench 11.0.0
  • CI runs on the full matrix (L11/L12/L13 × PHP 8.3/8.4/8.5)

binaryk and others added 2 commits March 30, 2026 14:37
- Update composer.json constraints for laravel/framework, illuminate/contracts,
  laravel/mcp, orchestra/testbench, and openai-php/laravel
- Add Laravel 13 + testbench 11 to CI test matrix
- Fix HasActionLogs trait to avoid calling Model::observe() during boot,
  which triggers recursive model instantiation in Laravel 13
@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented Mar 30, 2026

PR Summary

  • Laravel Version Updates: The project now supports Laravel 13., 12., and 11.*.
  • CI Configuration Change: We have moved from Vercel to Netlify for static site generation, improving our workflow.
  • New Setup and Archive Scripts: A new file polyscope.json contains scripts for setting up and archiving, making these processes much easier to handle.
  • Code Refactoring for Readability: Direct class references are now used in the RoutesDefinition.php to make the route controller references easier to read. The same applies to several command classes and other code files with type hints and extension annotations simplified.
  • Clarified Documentation: Annotations in multiple files have been updated for direct usage, providing a clearer idea of how to go about using various components of our codebase.
  • Direct Usage of Namespaces: Instead of using long fully qualified names, this PR engages more with the Illuminate\Http namespace and more specific class names to make code easier to read and maintain.
  • Revamped Error Handling: By handling specific exceptions without full namespace paths, errors will be easier to manage and fix.
  • Bootstrap Process Simplification: The new registerActionLogListeners() method in HasActionLogs.php now has a streamlined and easy-to-comprehend bootstrap process.
  • Test File Upgrades: Several test files were modified to use direct namespace calls and ensure proper operations. The cache entry count assertions have been verified, and instantiation of objects during tests has been simplified.

The key benefit of all these changes is increasing the codebase's cleanliess and clarity, making the project much more readable, maintainable, and smooth functioning.

@binaryk binaryk merged commit 23a6882 into 10.x Mar 30, 2026
33 checks passed
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