Skip to content

Support Laravel Debugbar 4 (Laravel 13)#27

Open
austinderrick wants to merge 3 commits into
wintercms:mainfrom
austinderrick:wip/laravel-13
Open

Support Laravel Debugbar 4 (Laravel 13)#27
austinderrick wants to merge 3 commits into
wintercms:mainfrom
austinderrick:wip/laravel-13

Conversation

@austinderrick
Copy link
Copy Markdown

@austinderrick austinderrick commented Jun 2, 2026

Depends on: wintercms/winter#1487 · wintercms/storm#228 (the WinterCMS Laravel 13 line — Laravel 13 is what requires Laravel Debugbar 4).

Summary

barryvdh/laravel-debugbar ^4 is required for Laravel 13 support, so this bumps the dependency from ^3.15 to ^4.2 and adapts the integration code accordingly.

Depends on the rest of the WinterCMS Laravel 13 work landing:

Changes

  • composer.json: barryvdh/laravel-debugbar ^3.15.0^4.2; php >=7.0>=8.3 (Laravel 13 minimum).
  • Plugin.php: Laravel Debugbar 4 removed Barryvdh\Debugbar\SymfonyHttpDriver and now configures its own LaravelHttpDriver, so the manual HTTP-driver wiring in register() (and the now-unused SymfonyHttpDriver / SessionManager imports) is removed.
  • classes/WinterDebugbar.php: Laravel Debugbar 4 performs renderer configuration inside getJavascriptRenderer(). WinterDebugbar now defers to the parent to build/cache the renderer and registers Winter's stylesheet via the renderer asset API (addAssets()), matching the updated ?string ... : JavascriptRenderer signature.
  • classes/JavascriptRenderer.php: removed — the custom subclass (which only injected Winter's CSS) is no longer needed.

Compatibility

Targets Laravel Debugbar 4 / Laravel 13 (Winter 1.3 line).

Related WinterCMS Laravel 13 PRs

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated Laravel Debugbar integration to a newer package version, enhancing compatibility with modern Laravel installations.
    • Refactored debugbar middleware and service registration for improved maintainability.
    • Increased minimum required PHP version from 7.0 to 8.3.

barryvdh/laravel-debugbar ^4 is required for Laravel 13 support. This bumps the
dependency from ^3.15 to ^4.2 and adapts the integration code:

- Laravel Debugbar 4 removed Barryvdh\Debugbar\SymfonyHttpDriver and now configures
  its own LaravelHttpDriver, so the manual HTTP-driver wiring in Plugin::register()
  is removed (and the now-unused SymfonyHttpDriver / SessionManager imports).
- Laravel Debugbar 4 performs renderer configuration inside getJavascriptRenderer().
  WinterDebugbar now defers to the parent to build/cache the renderer and registers
  Winter's stylesheet via the renderer asset API, replacing the old custom
  JavascriptRenderer subclass (removed).
- php >= 8.3 to match Laravel 13.

PRs that depend on this: wintercms/storm#228, wintercms/winter#1487.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

Warning

Review limit reached

@austinderrick, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 26 minutes and 48 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c7946919-795e-417b-a587-067bbbdaa527

📥 Commits

Reviewing files that changed from the base of the PR and between dd9b53f and 3b79e87.

📒 Files selected for processing (4)
  • Plugin.php
  • collectors/BackendCollector.php
  • collectors/CmsCollector.php
  • collectors/ComponentsCollector.php

Walkthrough

This pull request migrates the Winter Debugbar plugin from the Barryvdh Laravel Debugbar library (v3.15.0) to the Fruitcake fork (v4.2) and raises the minimum PHP version to 8.3. The service container registration, service provider, and HTTP middleware are refactored to use the new Fruitcake namespace. The custom JavascriptRenderer class is removed and its CSS injection logic is consolidated into WinterDebugbar.getJavascriptRenderer via the renderer's asset API. Type hints and PHPDoc annotations are added throughout for type safety, and the InjectDebugbar middleware is reimplemented without extending the base Barryvdh middleware.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Support Laravel Debugbar 4 (Laravel 13)' clearly and concisely summarizes the main objective of the PR, which is to update the plugin for compatibility with Laravel Debugbar 4 required by Laravel 13.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% 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.

✏️ 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
composer.json (1)

36-38: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update dont-discover to match the new package name.

The auto-discovery exclusion still references barryvdh/laravel-debugbar, but the package is now fruitcake/laravel-debugbar. This should be updated for consistency and to ensure discovery is properly disabled for the correct package.

🔧 Proposed fix
         "laravel": {
             "dont-discover": [
-                "barryvdh/laravel-debugbar"
+                "fruitcake/laravel-debugbar"
             ]
         }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@composer.json` around lines 36 - 38, Update the dont-discover entry that
currently references "barryvdh/laravel-debugbar" to the new package name
"fruitcake/laravel-debugbar" so the auto-discovery exclusion targets the correct
package; locate the "dont-discover" array in composer.json and replace the old
package string with the new one.
🧹 Nitpick comments (1)
composer.json (1)

28-28: ⚡ Quick win

barryvdh/laravel-debugbar v4.x resolves correctly; switching to fruitcake/laravel-debugbar is optional

  • composer.json still requires barryvdh/laravel-debugbar:^4.2 and extra.laravel.dont-discover excludes barryvdh/laravel-debugbar (composer.json:28, 36-38).
  • composer.lock shows Composer installs barryvdh/laravel-debugbar v4.2.x while sourcing code from the fruitcake/laravel-debugbar repository, so this should not break dependency resolution.
  • Updating both the require entry and the dont-discover entry to fruitcake/laravel-debugbar is a consistency/forward-compat improvement, but not required to fix installs.
Optional consistency change
-        "barryvdh/laravel-debugbar": "^4.2"
+        "fruitcake/laravel-debugbar": "^4.2"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@composer.json` at line 28, The composer.json currently references
"barryvdh/laravel-debugbar" in the require section and excludes that package
under extra.laravel.dont-discover; update both the require entry and the
dont-discover entry to "fruitcake/laravel-debugbar" to make package naming
consistent with the upstream source (change occurrences of the symbol
barryvdh/laravel-debugbar to fruitcake/laravel-debugbar), then run Composer
validate and composer update to refresh composer.lock if desired.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@composer.json`:
- Around line 36-38: Update the dont-discover entry that currently references
"barryvdh/laravel-debugbar" to the new package name "fruitcake/laravel-debugbar"
so the auto-discovery exclusion targets the correct package; locate the
"dont-discover" array in composer.json and replace the old package string with
the new one.

---

Nitpick comments:
In `@composer.json`:
- Line 28: The composer.json currently references "barryvdh/laravel-debugbar" in
the require section and excludes that package under extra.laravel.dont-discover;
update both the require entry and the dont-discover entry to
"fruitcake/laravel-debugbar" to make package naming consistent with the upstream
source (change occurrences of the symbol barryvdh/laravel-debugbar to
fruitcake/laravel-debugbar), then run Composer validate and composer update to
refresh composer.lock if desired.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fc4a74b1-13ce-47f8-9109-c906c46e526e

📥 Commits

Reviewing files that changed from the base of the PR and between d5e5fbd and dd9b53f.

📒 Files selected for processing (9)
  • Plugin.php
  • classes/JavascriptRenderer.php
  • classes/ServiceProvider.php
  • classes/WinterDebugbar.php
  • composer.json
  • middleware/InjectDebugbar.php
  • middleware/InterpretsAjaxExceptions.php
  • twig/extension/Debug.php
  • twig/extension/Stopwatch.php
💤 Files with no reviewable changes (1)
  • classes/JavascriptRenderer.php

- Resolve WinterDebugbar via the container so the new LaravelDebugbar(Application, Request)
  constructor dependencies are injected.
- Guard the models collector with hasCollector() (Laravel Debugbar 4 registers a default
  models collector, causing a duplicate-collector exception).
- Only register a Twig profile collector when the php-debugbar bridge class exists (php-debugbar
  no longer bundles one).
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