fix: resolve Debugbar facade at runtime to support Barryvdh and Fruitcake implementations#118
Merged
mechelon merged 1 commit intobeyondcode:devfrom Mar 20, 2026
Conversation
…cake implementations
mechelon
added a commit
that referenced
this pull request
Mar 20, 2026
Merge PR #118: replace hardcoded Debugbar facade imports with runtime resolution supporting barryvdh v3/v4 and fruitcake implementations. Fix testbench version range for Laravel 13 and normalize || separators in composer.json.
mechelon
added a commit
that referenced
this pull request
Mar 20, 2026
Normalize || separators in composer.json. Align workflow testbench constraint with Laravel 13 (11.*). Debugbar facade runtime resolution is handled separately in PR #118. Made-with: Cursor
mechelon
added a commit
that referenced
this pull request
Mar 20, 2026
Normalize || separators in composer.json. Align workflow testbench constraint with Laravel 13 (11.*). Debugbar facade runtime resolution is handled separately in PR #118. Made-with: Cursor
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
The Debugbar output crashes with a fatal error when
fruitcake/laravel-debugbaris installed instead of
barryvdh/laravel-debugbar, or when neither is present.The existing code had a
class_existsguard around the Fruitcake path but leftthe Barryvdh fallback completely unguarded — if the Fruitcake check fails and
Barryvdh isn't installed either, the app 500s.
Changes
useimports and branchingif/elsewith a singleresolveDebugbarFacade()method that checks all known facade FQCNs viaclass_exists()and returns the first matchboot()early-returns if no Debugbar is foundbarryvdh/laravel-debugbarv3, v4+, andfruitcake/laravel-debugbar$candidatesarrayTest plan
barryvdh/laravel-debugbarv3 — verify N+1 messages appear in Debugbarbarryvdh/laravel-debugbarv4+ — verify N+1 messages appear in Debugbarfruitcake/laravel-debugbar— verify N+1 messages appear in Debugbar