rocont / laravel-blade-debugbar
Laravel Debugbar tab that shows variables passed to Blade views
v2.0.1
2026-03-16 05:12 UTC
Requires
- php: ^8.0
- fruitcake/laravel-debugbar: ^4.0
- illuminate/support: ^9.0|^10.0|^11.0|^12.0
- illuminate/view: ^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^7.0|^8.0|^9.0|^10.0
This package is not auto-updated.
Last update: 2026-03-17 03:24:16 UTC
README
A Laravel Debugbar extension that adds a Blade Variables tab showing all variables passed to Blade views.
Features
- Displays all variables passed to each Blade template in a dump()-like format
- Automatically filters out Laravel system variables (
__env,app,errors, etc.) - Converts Eloquent models and collections to arrays for readable output
- Marks or hides shared variables (
View::share()) - Optional grouping by view name
- Alphabetical sorting
Requirements
- PHP 8.0+
- Laravel 9, 10, 11, or 12
- barryvdh/laravel-debugbar 3.7+
Installation
composer require --dev rocont/laravel-blade-debugbar
The service provider is registered automatically via Laravel Package Discovery.
Configuration
Publish the config file:
php artisan vendor:publish --tag=blade-debugbar-config
This creates config/blade-debugbar.php:
return [ // Group variables by Blade view name (e.g. "welcome → $title") 'group_by_view' => false, // Additional variables to exclude (system variables are always excluded) 'excluded_variables' => [], // How to handle View::share() variables: "mark", "hide", or "show" 'shared_mode' => 'mark', ];
Options
| Option | Values | Default | Description |
|---|---|---|---|
group_by_view |
true / false |
false |
Group variables by Blade view name |
excluded_variables |
array |
[] |
Additional variable names to exclude |
shared_mode |
mark / hide / show |
mark |
How to display shared variables |
Shared mode
mark— shared variables are shown with a[shared]prefix, e.g.[shared] $currentUserhide— shared variables are excluded completelyshow— shared variables are shown without any distinction
Usage
Once installed, open any page in your Laravel app. The Debugbar will show a new Blade Variables tab with all variables passed to each rendered Blade template.
Example output
Flat mode (group_by_view: false):
$posts → array (3) [...]
$title → "Blog"
[shared] $user → array ["id" => 1, "name" => "John"]
Grouped mode (group_by_view: true):
blog.index → $posts → array (3) [...]
blog.index → $title → "Blog"
layouts.app → [shared] $user → array ["id" => 1, "name" => "John"]
Testing
composer test
Or directly:
vendor/bin/phpunit
License
MIT