Polyscope - The agent-first dev environment for Laravel

Php Debugbar

Php Debugbar stats

Downloads
15.4M
Stars
4,286
Open Issues
5
Forks
414

View on GitHub →

Debug bar in the browser for php application

PHP Debug Bar

Displays a debug bar in the browser with information from php. No more var_dump() in your code!

Note: Debug Bar is for development use only. Never install this on websites that are publicly accessible.

Debugbar has had significant updates in 3.x (January 2026). See the Release Notes for more information and breaking changes.

Features:

  • Generic Debug Bar for PHP projects
  • Easy to integrate with any project
  • Clean, fast and easy to use interface
  • Handles AJAX request
  • Includes generic data collectors and collectors for well known libraries
  • The client side bar is 100% coded in plain javascript
  • Easily create your own collectors and their associated view in the bar
  • Save and re-open previous requests
  • Very well documented

Includes collectors for:

Checkout the demo for examples and php-debugbar.com for a live example.

Additional collectors are available here:

Integrations with other frameworks:

(drop me a message or submit a PR to add your DebugBar related project here)

Installation

The best way to install DebugBar is using Composer with the following command:

composer require --dev php-debugbar/php-debugbar

Quick start

DebugBar is very easy to use and you can add it to any of your projects in no time. The easiest way is using the render() functions

<?php
 
// Require the Composer autoloader, if not already loaded
require 'vendor/autoload.php';
 
use DebugBar\StandardDebugBar;
 
$debugbar = new StandardDebugBar();
$debugbarRenderer = $debugbar->getJavascriptRenderer();
 
$debugbar["messages"]->addMessage("hello world!");
?>
<html>
<head>
<?php echo $debugbarRenderer->renderHead() ?>
</head>
<body>
...
<?php echo $debugbarRenderer->render() ?>
</body>
</html>

The DebugBar uses DataCollectors to collect data from your PHP code. Some of them are automated but others are manual. Use the DebugBar like an array where keys are the collector names. In our previous example, we add a message to the MessagesCollector:

$debugbar["messages"]->addMessage("hello world!");

StandardDebugBar activates the following collectors:

  • MemoryCollector (memory)
  • MessagesCollector (messages)
  • PhpInfoCollector (php)
  • RequestDataCollector (request)
  • TimeDataCollector (time)
  • ExceptionsCollector (exceptions)

Learn more about DebugBar in the docs.

Demo

To run the demo, clone this repository and start the Built-In PHP webserver from the demo folder:

composer run demo

Then visit http://localhost:8000/

Testing

To test, run php vendor/bin/phpunit. To debug Browser tests, you can run PANTHER_NO_HEADLESS=1 vendor/bin/phpunit --debug. Run vendor/bin/bdi detect drivers to download the latest drivers.

Contributing

When contributing to the JavaScript codebase:

  1. Run npm run lint and npm run build before committing
  2. Fix any errors (warnings are acceptable but should be minimized)
  3. Use npm run lint:fix for automatic fixes where possible
  4. Follow the ES6+ patterns established in the codebase

When contributing to the PHP codebase:

  1. Run composer check-style and composer analyse before committing.
  2. Make sure the tests pass (see above)
  3. Verify that the demo works correctly (php -S localhost:8000 demo/)
Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Php Debugbar Php Debugbar Related Articles

PHP DebugBar v3 is released image

PHP DebugBar v3 is released

Read article
Statamic 5 is released! image

Statamic 5 is released!

Read article
Raw Query Output With Bindings is Coming to Laravel 10 image

Raw Query Output With Bindings is Coming to Laravel 10

Read article
Eloquent Performance: 4 Examples of N+1 Query Problems image

Eloquent Performance: 4 Examples of N+1 Query Problems

Read article
Laravel Playground image

Laravel Playground

Read article
Laravel 7.18 Released image

Laravel 7.18 Released

Read article
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Tighten logo

Tighten

We help companies turn great ideas into amazing apps, products, and services.

Tighten
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Securing Laravel logo

Securing Laravel

The essential security resource for Laravel devs, covering everything you need to keep your apps secure. Sign up to receive weekly security tips and monthly in depth articles, diving deep into security concepts you need to know!

Securing Laravel
Statamic logo

Statamic

The drop-in ready Laravel CMS you’re been waiting for. Go full-stack or headless, flat file or database – it’s up to you.

Statamic
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum