Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here


Laravel Debugbar (Integrates PHP Debug Bar)

Star full 4f7b624809470f25b6493d5a7b30d9b9cb905931146e785d67c86ef0c205a402Star blank 374f33e4d622a2930833db3cbea26b5d03dc44961a6ecab0b9e13276d97d6682Star blank 374f33e4d622a2930833db3cbea26b5d03dc44961a6ecab0b9e13276d97d6682Star blank 374f33e4d622a2930833db3cbea26b5d03dc44961a6ecab0b9e13276d97d6682Star blank 374f33e4d622a2930833db3cbea26b5d03dc44961a6ecab0b9e13276d97d6682 (1 ratings)
Rated 1.0 out of 5
Subscribe to updates I use laravel-debugbar

Statistics on laravel-debugbar

Number of watchers on Github 11256
Number of open issues 381
Average time to close an issue 11 days
Main language PHP
Average time to merge a PR 12 days
Open pull requests 57+
Closed pull requests 38+
Last commit 16 days ago
Repo Created almost 7 years ago
Repo Last Updated 16 days ago
Size 2.25 MB
Organization / Authorbarryvdh
Latest Releasev3.3.3
Page Updated
Do you use laravel-debugbar? Leave a review!
View open issues (381)
View laravel-debugbar activity
View TODOs for laravel-debugbar (1)
View on github
Fresh, new opensource launches πŸš€πŸš€πŸš€
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating laravel-debugbar for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Laravel Debugbar

Packagist License Latest Stable Version Total Downloads

This is a package to integrate PHP Debug Bar with Laravel. It includes a ServiceProvider to register the debugbar and attach it to the output. You can publish assets and configure it through Laravel. It bootstraps some Collectors to work with Laravel and implements a couple custom DataCollectors, specific for Laravel. It is configured to display Redirects and (jQuery) Ajax Requests. (Shown in a dropdown) Read the documentation for more configuration options.

Debugbar 3.3 Screenshot

Note: Use the DebugBar only in development. It can slow the application down (because it has to gather data). So when experiencing slowness, try disabling some of the collectors.

This package includes some custom collectors:

  • QueryCollector: Show all queries, including binding + timing
  • RouteCollector: Show information about the current Route.
  • ViewCollector: Show the currently loaded views. (Optionally: display the shared data)
  • EventsCollector: Show all events
  • LaravelCollector: Show the Laravel version and Environment. (disabled by default)
  • SymfonyRequestCollector: replaces the RequestCollector with more information about the request/response
  • LogsCollector: Show the latest log entries from the storage logs. (disabled by default)
  • FilesCollector: Show the files that are included/required by PHP. (disabled by default)
  • ConfigCollector: Display the values from the config files. (disabled by default)
  • CacheCollector: Display all cache events. (disabled by default)

Bootstraps the following collectors for Laravel:

  • LogCollector: Show all Log messages
  • SwiftMailCollector and SwiftLogCollector for Mail

And the default collectors:

  • PhpInfoCollector
  • MessagesCollector
  • TimeDataCollector (With Booting and Application timing)
  • MemoryCollector
  • ExceptionsCollector

It also provides a Facade interface for easy logging Messages, Exceptions and Time


Require this package with composer. It is recommended to only require the package for development.

composer require barryvdh/laravel-debugbar --dev

Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

The Debugbar will be enabled when APP_DEBUG is true.

If you use a catch-all/fallback route, make sure you load the Debugbar ServiceProvider before your own App ServiceProviders.

Laravel without auto-discovery:

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php


If you want to use the facade to log messages, add this to your facades in app.php:

'Debugbar' => Barryvdh\Debugbar\Facade::class,

The profiler is enabled by default, if you have APP_DEBUG=true. You can override that in the config (debugbar.enabled) or by setting DEBUGBAR_ENABLED in your .env. See more options in config/debugbar.php You can also set in your config if you want to include/exclude the vendor files also (FontAwesome, Highlight.js and jQuery). If you already use them in your site, set it to false. You can also only display the js or css vendors, by setting it to 'js' or 'css'. (Highlight.js requires both css + js, so set to true for syntax highlighting)

Copy the package config to your local config with the publish command:

php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"


For Lumen, register a different Provider in bootstrap/app.php:

if (env('APP_DEBUG')) {

To change the configuration, copy the file to your config folder and enable it:



You can now add messages using the Facade (when added), using the PSR-3 levels (debug, info, notice, warning, error, critical, alert, emergency):

Debugbar::warning('Watch out');
Debugbar::addMessage('Another message', 'mylabel');

And start/stop timing:

Debugbar::startMeasure('render','Time for rendering');
Debugbar::addMeasure('now', LARAVEL_START, microtime(true));
Debugbar::measure('My long operation', function() {
    // Do something

Or log exceptions:

try {
    throw new Exception('foobar');
} catch (Exception $e) {

There are also helper functions available for the most common calls:

// All arguments will be dumped as a debug message
debug($var1, $someString, $intValue, $object);

start_measure('render','Time for rendering');
add_measure('now', LARAVEL_START, microtime(true));
measure('My long operation', function() {
    // Do something

If you want you can add your own DataCollectors, through the Container or the Facade:

Debugbar::addCollector(new DebugBar\DataCollector\MessagesCollector('my_messages'));
//Or via the App container:
$debugbar = App::make('debugbar');
$debugbar->addCollector(new DebugBar\DataCollector\MessagesCollector('my_messages'));

By default, the Debugbar is injected just before </body>. If you want to inject the Debugbar yourself, set the config option 'inject' to false and use the renderer yourself and follow http://phpdebugbar.com/docs/rendering.html

$renderer = Debugbar::getJavascriptRenderer();

Note: Not using the auto-inject, will disable the Request information, because that is added After the response. You can add the default_request datacollector in the config as alternative.

Enabling/Disabling on run time

You can enable or disable the debugbar during run time.


NB. Once enabled, the collectors are added (and could produce extra overhead), so if you want to use the debugbar in production, disable in the config and only enable when needed.

Twig Integration

Laravel Debugbar comes with two Twig Extensions. These are tested with rcrowe/TwigBridge 0.6.x

Add the following extensions to your TwigBridge config/extensions.php (or register the extensions manually)


The Dump extension will replace the dump function to output variables using the DataFormatter. The Debug extension adds a debug() function which passes variables to the Message Collector, instead of showing it directly in the template. It dumps the arguments, or when empty; all context variables.

{{ debug() }}
{{ debug(user, categories) }}

The Stopwatch extension adds a stopwatch tag similar to the one in Symfony/Silex Twigbridge.

{% stopwatch "foo" %}
    some things that gets timed
{% endstopwatch %}
laravel-debugbar open issues Ask a question     (View All Issues)
  • over 3 years JS error in the widget for the displaying sql queries
  • over 3 years [Question] How only use clockwork?
  • almost 4 years Hello,i found /vender/barryvdh/laravel-debugbar/src/Facade
  • almost 4 years FilesCollector not support Lumen
  • almost 4 years css is not loaded error in console
  • almost 4 years REGEXP wrong syntax
  • almost 4 years Show query count in table view
  • almost 4 years problem with RTL languages
  • almost 4 years Call to undefined method DebugBar\DebugBar::error()
  • almost 4 years New http request are automatically selected
  • about 4 years Unable to install debugger on laravel 5.1.*
  • about 4 years MultiAuthCollector cause session token regeneration
  • about 4 years Changelog is out of date
  • about 4 years Shouldn't debugbar view the ajax data after catching it?
  • about 4 years Using custom queue driver causes mail collector to throw exception.
  • about 4 years laravel add Facades is not work
  • about 4 years Debug false but true for some IP's
  • about 4 years Make it work without guzzle
  • about 4 years debugbar not showing in laravel module structure
  • about 4 years Responses selectbox auto-select
  • about 4 years Can't install the bar
  • about 4 years remove debugbar
  • about 4 years QueryCollector bug
  • about 4 years Breaks flow and outputs HTML after post request with redirection
  • about 4 years Add native collection of pdo
  • over 4 years Debugbar stays visible even when debug=false
  • over 4 years maybe a bug
  • over 4 years not showing up in laravel spark
  • over 4 years option to allow log part of the database query only
  • over 4 years How to work with Mongodb
laravel-debugbar open pull requests (View All Pulls)
  • Adds option for requirejs compatibility
  • Allow for middleware to check to see if the debug bar is enabled
  • Merge PR from Dukeman330/laravel-debugbar to enable standalone /debugbar route, e.g. to debug REST APIs
  • Routes blacklist.
  • add time to events
  • added syntax highlighting
  • debugbar specific locations should have debugbar enabled by default
  • fix the problem when run php artisan debugbar:clear it can't clear the storage/debugbar folder
  • [L4] Fix for addon crash when DB::disableQueryLog() was called in a user application
  • Refacto the way user info are displayed
  • Disable specific vendors
  • Update readme.md fixing wording
  • Force left-to-right direction
  • Move enabled check higher up
  • Route prefix support added for Laravel Debug Bar internal routes (Laravel 4.x)
  • add db query length limit option
  • Ported Session Flash bug fix from latest version
  • fix: Route caching
  • Add newline character.
  • Use short array syntax.
  • Update readme.md
  • Change php7 errors to exception to maintain compatability with function declaration #497
  • Bugfix for when sql param is not a questionmark
  • Setting 'enable' by .env file
  • adjust middleware order
  • Give rows a little more breathing space, especially for the query tab
  • option to only collect slow queries
  • Fix for displaying middleware names
  • fixing display in RTL languages
  • Option to use debugbar with content-security-policy headers
  • Add Xdebug Link functionality
  • Update Installation
  • env
  • Enable/Disable via environment
  • Add route domain config option
  • Support instance of application in Lumen
  • Support phpredis php extension
  • Add Lumen collector
  • Update license year
  • Add custom request filter (#693)
  • Laravel 5.6 support, added missed VarColner at EventCollector.php
  • [queries] Support double question mark
  • Adds check for availability of jQuery
  • Move route definition into separate file - v2
  • Add CSP header if available
  • fix error Undefined property SessionGuard
  • Added numerical ordering for widgets list
  • Stop disabling 'testing' environment
  • feat: add configuration of additional route group middleware
  • Fix issue with MonologCollector collector for Laravel >= v5.6
  • Uncaught TypeError: PhpDebugBar.Widgets.TemplatesWidget is not a cons…
  • Fix DocBlock: `message` parameter type
  • Fixed #306
  • Fix broken table representation in Views
  • Fix style for params table
  • Enable export all queries to csv
  • Config flag to log request global stats
laravel-debugbar questions on Stackoverflow (View All Questions)
  • Laravel-Debugbar not catching AJAX call (Angular call)
  • Laravel 5: Enable laravel-debugbar
  • Laravel Debugbar messages not showing
  • Using Laravel Debugbar, how can I disable exception logging?
laravel-debugbar list of languages used
laravel-debugbar latest release notes
v3.3.3 Support Livewire requests

Render the Livewire widgets in the debugbar, like normale ajax requests.

screencast-127 0 0 1_8000-2020 05 05-12_59_32

v3.3.1 Tweak models/timeline
Other projects in PHP