Laravel Cloud is here! Zero-config managed infrastructure for Laravel apps. Deploy now.

Laravel Debugbar

barryvdh/laravel-debugbar image

Laravel Debugbar stats

Downloads
64M
Stars
15,580
Open Issues
100
Forks
1,548

View on GitHub →

PHP Debugbar integration for Laravel

Barryvdh Laravel Debugbar Package Summary

The Barryvdh Laravel Debugbar package integrates PHP Debug Bar with Laravel, providing a powerful and flexible way to add debugging capabilities directly into your Laravel applications. Ideal for development environments, this tool helps you monitor various aspects of your application without affecting production performance.

Key Features

  • Multiple Data Collectors: Includes collectors for queries, routes, views, events, Laravel environment, request/response data, and more.
  • Integration with Laravel: Seamlessly integrates with Laravel's service provider and uses facades for easier logging and message handling.
  • Customizable: Enable or disable individual collectors, manage vendor files inclusion, and configure through Laravel's environment settings or directly in the config file.
  • Runtime Control: Easily enable or disable the Debugbar during runtime via simple method calls.
  • Storage and History: Stores data from requests for later analysis, accessible through a browser interface.
  • Twig Support: Includes extensions for Twig to use Debugbar functions within templates.

Installation

Install via composer for development environments only to prevent potential data leakage and performance hits in production:

composer require barryvdh/laravel-debugbar --dev

Laravel's package auto-discovery handles the service provider linking. After installation, publish configuration and assets using:

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

For non-auto-discovery setups, manually add the service provider and facade in your config/app.php.

Configuration

  • Enable or disable Debugbar in your .env file using DEBUGBAR_ENABLED or directly in the config/debugbar.php.
  • Customize data collectors, manage asset loading, and configure storage options through the published configuration file.

Usage

Utilize the Debugbar for logging, timing, and error handling:

Debugbar::info($object);
Debugbar::error('Error!');
Debugbar::startMeasure('render', 'Time for rendering');
Debugbar::stopMeasure('render');

Debugbar supports conditional enabling/disabling, which can be adjusted during runtime:

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

Security Note

Only use Debugbar in development environments or securely restricted areas of staging environments. Ensure it is disabled in production to prevent performance degradation and information exposure.

Additional Integration

For Lumen or Laravel Octane, specific configuration steps are required, detailed in the package documentation. Debugbar also supports integration with Twig through additional extensions, enhancing debugging capabilities within Twig templates.

In summary, the Laravel Debugbar by Barryvdh is an essential tool for developers looking to streamline their debugging processes efficiently, offering extensive customization and integration options tailored for Laravel applications.

Cube

Laravel Newsletter

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


Barryvdh Laravel Debugbar Related Articles

Laravel Debugbar v4.0.0 is released image

Laravel Debugbar v4.0.0 is released

Read article
Laravel Debugbar Gets a Big UI Update image

Laravel Debugbar Gets a Big UI Update

Read article
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
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
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Tinkerwell logo

Tinkerwell

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

Tinkerwell
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media