PHPackages                             barryvdh/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. barryvdh/laravel-debugbar

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

barryvdh/laravel-debugbar
=========================

PHP Debugbar integration for Laravel

v4.1.3(2mo ago)19.2k124.3M—4.6%1.6k[75 issues](https://github.com/fruitcake/laravel-debugbar/issues)[3 PRs](https://github.com/fruitcake/laravel-debugbar/pulls)20MITPHPPHP ^8.2CI passing

Since Sep 25Pushed 1w ago273 watchersCompare

[ Source](https://github.com/fruitcake/laravel-debugbar)[ Packagist](https://packagist.org/packages/barryvdh/laravel-debugbar)[ Fund](https://fruitcake.nl)[ GitHub Sponsors](https://github.com/barryvdh)[ RSS](/packages/barryvdh-laravel-debugbar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (36)Versions (371)Used By (20)

Debugbar for Laravel
--------------------

[](#debugbar-for-laravel)

[![Unit Tests](https://github.com/fruitcake/laravel-debugbar/workflows/Unit%20Tests/badge.svg)](https://github.com/fruitcake/laravel-debugbar/workflows/Unit%20Tests/badge.svg)[![Packagist License](https://camo.githubusercontent.com/e60623f508586f049d48cfb8396ee411b0c9bc3be174381a1893c37462a3c1e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e63652d4d49542d626c7565)](https://choosealicense.com/licenses/mit)[![Latest Stable Version](https://camo.githubusercontent.com/6dc32a2c15b52c1db4bb0f0f03b05d425459ebb1d897326ec0d91da4dfcec37c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667275697463616b652f6c61726176656c2d64656275676261723f6c6162656c3d537461626c65)](https://packagist.org/packages/fruitcake/laravel-debugbar)[![Total Downloads](https://camo.githubusercontent.com/ed826f947562863081892842a2e2a872d1e754d26e3c3a8aea38f101ec21aaa2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62617272797664682f6c61726176656c2d64656275676261723f6c6162656c3d446f776e6c6f616473)](https://packagist.org/packages/fruitcake/laravel-debugbar)[![Fruitcake](https://camo.githubusercontent.com/28d7584b52e33d7b4ffb6b1bef8b89b6e598adb45c8c0d5f80349c1c304f385e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f776572656425323042792d467275697463616b652d6232626333352e737667)](https://fruitcake.nl)

This is a package to integrate [PHP Debug Bar](https://github.com/php-debugbar/php-debugbar) 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 Ajax/Livewire Requests, which are shown in a dropdown. Read the [documentation](https://php-debugbar.com/docs) for more configuration options.

[![Debugbar Dark Mode screenshot](https://private-user-images.githubusercontent.com/973269/311704767-6600837a-8b2d-4acb-ab0c-158c9ca5439c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzkxNjkyMDksIm5iZiI6MTc3OTE2ODkwOSwicGF0aCI6Ii85NzMyNjkvMzExNzA0NzY3LTY2MDA4MzdhLThiMmQtNGFjYi1hYjBjLTE1OGM5Y2E1NDM5Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNTE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDUxOVQwNTM1MDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02ZmY4NTdjNzYyMDUyZjgxNzZmYTY0NGZiYTBkZGU5NDQ1ZWRiYzc3ODVlMThmZTBkYzY1NjA0Njc5YzRjYjFhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.dNV8eaxHyfJwMqi-wLvKgYREJBKF8Vgn5aRBj35pN94)](https://private-user-images.githubusercontent.com/973269/311704767-6600837a-8b2d-4acb-ab0c-158c9ca5439c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzkxNjkyMDksIm5iZiI6MTc3OTE2ODkwOSwicGF0aCI6Ii85NzMyNjkvMzExNzA0NzY3LTY2MDA4MzdhLThiMmQtNGFjYi1hYjBjLTE1OGM5Y2E1NDM5Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNTE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDUxOVQwNTM1MDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02ZmY4NTdjNzYyMDUyZjgxNzZmYTY0NGZiYTBkZGU5NDQ1ZWRiYzc3ODVlMThmZTBkYzY1NjA0Njc5YzRjYjFhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.dNV8eaxHyfJwMqi-wLvKgYREJBKF8Vgn5aRBj35pN94)

Caution

Use the DebugBar only in development. Do not use Debugbar on publicly accessible websites, as it will leak information from stored requests (by design).

Warning

It can also slow the application down (because it has to gather and render 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
- SymfonyMailCollector for Mail

And the default collectors:

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

It also provides a facade interface (`Debugbar`) 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 fruitcake/laravel-debugbar --dev
```

> Note: The package name has changed to `fruitcake/laravel-debugbar`. If you're using `barryvdh/laravel-debugbar`, you can safely replace this with the new package name: `composer remove barryvdh/laravel-debugbar --dev --no-scripts`

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` and when the environment is not `production` or `testing`.

You can disable it 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:

[](#copy-the-package-config-to-your-local-config-with-the-publish-command)

```
php artisan vendor:publish --provider='Fruitcake\LaravelDebugbar\ServiceProvider'
```

### Laravel with Octane:

[](#laravel-with-octane)

Laravel Debugbar 4.x works out of the box with Octane. No need to add anything to your config.

If you're upgrading from Laravel Debugbar 3.x, remove the 'flush' config for Debugbar in `config/octane.php`.

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

// `$collection->debug()` will return the collection and dump it as a debug message. Like `$collection->dump()`
collect([$var1, $someString])->debug();

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.

> Note: by default Debugbar can only be enabled in debug mode and non-production environments. It's highly recommended to don't install this in production at all. If you really need to enable it in production, you can set `debugbar.force_allow_enable` to true, or set `DEBUGBAR_FORCE_ALLOW_ENABLE=true` in your .env. This will not enable the Debugbar, but will run the ServiceProvider bootstrap so you can enable it after booting.

Storage
-------

[](#storage)

Debugbar remembers previous requests, which you can view using the Browse button on the right. This will only work if you enable `debugbar.storage.open` in the config. Make sure you only do this on local development, because otherwise other people will be able to view previous requests. In general, Debugbar should only be used locally or at least restricted by IP. It's possible to pass a callback, which will receive the Request object, so you can determine access to the OpenHandler storage.

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)

```
'Fruitcake\LaravelDebugbar\Twig\Extension\Debug',
'Fruitcake\LaravelDebugbar\Twig\Extension\Dump',
'Fruitcake\LaravelDebugbar\Twig\Extension\Stopwatch',
```

The Dump extension will replace the [dump function](https://twig.symfony.com/doc/3.x/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](https://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 %}
```

Star History
------------

[](#star-history)

[![Star History Chart](https://camo.githubusercontent.com/6803e6a4cdc112965536d6f3bd49a6fe5ee0c650fe442be78aae283d148db5ae/68747470733a2f2f6170692e737461722d686973746f72792e636f6d2f7376673f7265706f733d667275697463616b652f6c61726176656c2d646562756762617226747970653d44617465)](https://www.star-history.com/#fruitcake/laravel-debugbar&Date)

###  Health Score

88

—

ExcellentBetter than 100% of packages

Maintenance93

Actively maintained with recent releases

Popularity89

Widely adopted with strong download metrics

Community65

Healthy contributor diversity

Maturity95

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 78.1% 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 ~20 days

Recently: every ~3 days

Total

226

Last Release

70d ago

Major Versions

v2.4.3 → v3.0.02017-08-28

2.4.x-dev → v3.2.32019-02-26

v3.16.3 → v4.0-beta.12025-12-31

v3.16.4 → v4.0-rc.12026-01-23

3.x-dev → v4.0.02026-01-23

PHP version history (9 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

v3.5.0PHP &gt;=7.2

v3.7.0PHP &gt;=7.2.5

v3.8.0PHP ^8.0

v3.15.0-beta1PHP ^8.1

v4.0-beta.1PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (997 commits)")[![erikn69](https://avatars.githubusercontent.com/u/4933954?v=4)](https://github.com/erikn69 "erikn69 (127 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (17 commits)")[![jnoordsij](https://avatars.githubusercontent.com/u/45041769?v=4)](https://github.com/jnoordsij "jnoordsij (11 commits)")[![laravel-debugbar](https://avatars.githubusercontent.com/u/160071132?v=4)](https://github.com/laravel-debugbar "laravel-debugbar (10 commits)")[![angeljqv](https://avatars.githubusercontent.com/u/79208641?v=4)](https://github.com/angeljqv "angeljqv (7 commits)")[![parallels999](https://avatars.githubusercontent.com/u/109294935?v=4)](https://github.com/parallels999 "parallels999 (6 commits)")[![sebdesign](https://avatars.githubusercontent.com/u/667144?v=4)](https://github.com/sebdesign "sebdesign (6 commits)")[![browner12](https://avatars.githubusercontent.com/u/5232313?v=4)](https://github.com/browner12 "browner12 (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![papajoker](https://avatars.githubusercontent.com/u/4622935?v=4)](https://github.com/papajoker "papajoker (5 commits)")[![ssw1cblarrion](https://avatars.githubusercontent.com/u/229024766?v=4)](https://github.com/ssw1cblarrion "ssw1cblarrion (4 commits)")[![Anahkiasen](https://avatars.githubusercontent.com/u/1321596?v=4)](https://github.com/Anahkiasen "Anahkiasen (4 commits)")[![ekvedaras](https://avatars.githubusercontent.com/u/3586184?v=4)](https://github.com/ekvedaras "ekvedaras (4 commits)")[![TristanMouchet](https://avatars.githubusercontent.com/u/15814977?v=4)](https://github.com/TristanMouchet "TristanMouchet (4 commits)")[![LukeTowers](https://avatars.githubusercontent.com/u/7253840?v=4)](https://github.com/LukeTowers "LukeTowers (4 commits)")[![martindilling](https://avatars.githubusercontent.com/u/1018838?v=4)](https://github.com/martindilling "martindilling (4 commits)")[![mccahan](https://avatars.githubusercontent.com/u/2308923?v=4)](https://github.com/mccahan "mccahan (4 commits)")[![nckrtl](https://avatars.githubusercontent.com/u/18613261?v=4)](https://github.com/nckrtl "nckrtl (4 commits)")[![kamui545](https://avatars.githubusercontent.com/u/356978?v=4)](https://github.com/kamui545 "kamui545 (4 commits)")

---

Tags

debugbardeveloper-toollaravelprofilertoolbarlaraveldevdebugprofilerdebugbarwebprofilerbarryvdh

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/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)
