PHPackages                             macromindonline/laravel-debugbar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. macromindonline/laravel-debugbar

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

macromindonline/laravel-debugbar
================================

PHP Debugbar integration for Laravel

v3.1.0(8y ago)011MITPHPPHP &gt;=7.0

Since Sep 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/macromindonline/laravel-debugbar)[ Packagist](https://packagist.org/packages/macromindonline/laravel-debugbar)[ RSS](/packages/macromindonline-laravel-debugbar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (92)Used By (0)

Laravel Debugbar
----------------

[](#laravel-debugbar)

[![Packagist License](https://camo.githubusercontent.com/b5924d4b515082b8e54cd79c8ac6f34a2cd87907b0c3e593dd80839d7cb39380/68747470733a2f2f706f7365722e707567782e6f72672f62617272797664682f6c61726176656c2d64656275676261722f6c6963656e73652e706e67)](http://choosealicense.com/licenses/mit/)[![Latest Stable Version](https://camo.githubusercontent.com/7277f25a1415fe85217e613cf532ebde9dc09a79d46cc331c1a37dca6dd8b3b4/68747470733a2f2f706f7365722e707567782e6f72672f62617272797664682f6c61726176656c2d64656275676261722f76657273696f6e2e706e67)](https://packagist.org/packages/barryvdh/laravel-debugbar)[![Total Downloads](https://camo.githubusercontent.com/130b2c3dea50f3b294b9bd3da3bd77127b230074eb0e6e450e1a7d57dee90633/68747470733a2f2f706f7365722e707567782e6f72672f62617272797664682f6c61726176656c2d64656275676261722f642f746f74616c2e706e67)](https://packagist.org/packages/barryvdh/laravel-debugbar)

### Note for v3: Debugbar is now enabled by requiring the package, but still needs APP\_DEBUG=true by default!

[](#note-for-v3-debugbar-is-now-enabled-by-requiring-the-package-but-still-needs-app_debugtrue-by-default)

### For Laravel &lt; 5.5, please use the [2.4 branch](https://github.com/barryvdh/laravel-debugbar/tree/2.4)!

[](#for-laravel--55-please-use-the-24-branch)

This is a package to integrate [PHP Debug Bar](http://phpdebugbar.com/) with Laravel 5. 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](http://phpdebugbar.com/docs/) for more configuration options.

[![Screenshot](https://cloud.githubusercontent.com/assets/973269/4270452/740c8c8c-3ccb-11e4-8d9a-5a9e64f19351.png)](https://cloud.githubusercontent.com/assets/973269/4270452/740c8c8c-3ccb-11e4-8d9a-5a9e64f19351.png)

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

Installation
------------

[](#installation)

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

```
composer require barryvdh/laravel-debugbar --dev
```

Laravel 5.5 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 5.5+:

[](#laravel-55)

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

```
Barryvdh\Debugbar\ServiceProvider::class,
```

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"
```

### Lumen:

[](#lumen)

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

```
if (env('APP_DEBUG')) {
 $app->register(Barryvdh\Debugbar\LumenServiceProvider::class);
}
```

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

```
$app->configure('debugbar');
```

Usage
-----

[](#usage)

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

```
Debugbar::info($object);
Debugbar::error('Error!');
Debugbar::warning('Watch out…');
Debugbar::addMessage('Another message', 'mylabel');
```

And start/stop timing:

```
Debugbar::startMeasure('render','Time for rendering');
Debugbar::stopMeasure('render');
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) {
    Debugbar::addThrowable($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');
stop_measure('render');
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 ``. If you want to inject the Debugbar yourself, set the config option 'inject' to false and use the renderer yourself and follow

```
$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
------------------------------

[](#enablingdisabling-on-run-time)

You can enable or disable the debugbar during run time.

```
\Debugbar::enable();
\Debugbar::disable();
```

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
----------------

[](#twig-integration)

Laravel Debugbar comes with two Twig Extensions. These are tested with [rcrowe/TwigBridge](https://github.com/rcrowe/TwigBridge) 0.6.x

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

```
'Barryvdh\Debugbar\Twig\Extension\Debug',
'Barryvdh\Debugbar\Twig\Extension\Dump',
'Barryvdh\Debugbar\Twig\Extension\Stopwatch',
```

The Dump extension will replace the [dump function](http://twig.sensiolabs.org/doc/functions/dump.html) 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](http://symfony.com/blog/new-in-symfony-2-4-a-stopwatch-tag-for-twig) similar to the one in Symfony/Silex Twigbridge.

```
{% stopwatch "foo" %}
    …some things that gets timed
{% endstopwatch %}
```

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 89.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~32 days

Total

87

Last Release

3084d ago

Major Versions

v1.8.6 → v2.0.02015-02-03

v1.8.7 → v2.0.12015-02-15

v1.8.8 → v2.4.02017-06-01

1.8.x-dev → v2.4.22017-07-11

v2.4.3 → v3.0.02017-08-28

PHP version history (4 changes)v0.1.0PHP &gt;=5.3.0

v2.0.0PHP &gt;=5.4.0

v2.2.0PHP &gt;=5.5.9

v3.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae0f7f1f69309bec448ac224b62d1eb8d0dd6e9477097d4a502cd0f78913042e?d=identicon)[macromindonline](/maintainers/macromindonline)

---

Top Contributors

[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (586 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (17 commits)")[![papajoker](https://avatars.githubusercontent.com/u/4622935?v=4)](https://github.com/papajoker "papajoker (5 commits)")[![sebdesign](https://avatars.githubusercontent.com/u/667144?v=4)](https://github.com/sebdesign "sebdesign (5 commits)")[![ltsochev-dev](https://avatars.githubusercontent.com/u/180402?v=4)](https://github.com/ltsochev-dev "ltsochev-dev (4 commits)")[![kamui545](https://avatars.githubusercontent.com/u/356978?v=4)](https://github.com/kamui545 "kamui545 (4 commits)")[![Anahkiasen](https://avatars.githubusercontent.com/u/1321596?v=4)](https://github.com/Anahkiasen "Anahkiasen (4 commits)")[![knvpk](https://avatars.githubusercontent.com/u/6078669?v=4)](https://github.com/knvpk "knvpk (3 commits)")[![martindilling](https://avatars.githubusercontent.com/u/1018838?v=4)](https://github.com/martindilling "martindilling (3 commits)")[![aik099](https://avatars.githubusercontent.com/u/1277526?v=4)](https://github.com/aik099 "aik099 (2 commits)")[![n0f](https://avatars.githubusercontent.com/u/10847587?v=4)](https://github.com/n0f "n0f (2 commits)")[![rmasters](https://avatars.githubusercontent.com/u/34284?v=4)](https://github.com/rmasters "rmasters (2 commits)")[![adelf](https://avatars.githubusercontent.com/u/2818394?v=4)](https://github.com/adelf "adelf (2 commits)")[![FractalizeR](https://avatars.githubusercontent.com/u/318489?v=4)](https://github.com/FractalizeR "FractalizeR (2 commits)")[![skyrpex](https://avatars.githubusercontent.com/u/1077520?v=4)](https://github.com/skyrpex "skyrpex (1 commits)")[![adanski](https://avatars.githubusercontent.com/u/2191641?v=4)](https://github.com/adanski "adanski (1 commits)")[![vesper8](https://avatars.githubusercontent.com/u/816028?v=4)](https://github.com/vesper8 "vesper8 (1 commits)")[![akshayagarwal](https://avatars.githubusercontent.com/u/1273012?v=4)](https://github.com/akshayagarwal "akshayagarwal (1 commits)")[![alanmanderson](https://avatars.githubusercontent.com/u/7490766?v=4)](https://github.com/alanmanderson "alanmanderson (1 commits)")[![andboson](https://avatars.githubusercontent.com/u/2089327?v=4)](https://github.com/andboson "andboson (1 commits)")

---

Tags

laraveldebugprofilerdebugbarwebprofiler

### Embed Badge

![Health badge](/badges/macromindonline-laravel-debugbar/health.svg)

```
[![Health](https://phpackages.com/badges/macromindonline-laravel-debugbar/health.svg)](https://phpackages.com/packages/macromindonline-laravel-debugbar)
```

###  Alternatives

[barryvdh/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k124.3M621](/packages/barryvdh-laravel-debugbar)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k28](/packages/fruitcake-laravel-debugbar)[recca0120/laravel-tracy

A Laravel Package to integrate Nette Tracy Debugger

388283.0k3](/packages/recca0120-laravel-tracy)[fruitcake/laravel-telescope-toolbar

Toolbar for Laravel Telescope based on Symfony Web Profiler

8041.6M3](/packages/fruitcake-laravel-telescope-toolbar)[snowair/phalcon-debugbar

Integrates PHP Debug Bar with Phalcon.

160123.3k1](/packages/snowair-phalcon-debugbar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
