2017 © Pedro Peláez
 

library debugbar

PHP Debugbar integration for Laravel

image

hxzzy/debugbar

PHP Debugbar integration for Laravel

  • Thursday, July 27, 2017
  • by 799857634
  • Repository
  • 0 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 751 Forks
  • 0 Open issues
  • 89 Versions
  • 250 % Grown

The README.md

Laravel Debugbar

Packagist License Latest Stable Version Total Downloads, (*1)

For Laravel < 5.5, please use the 2.4 branch!

This is a package to integrate PHP Debug Bar 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 for more configuration options., (*2)

Screenshot, (*3)

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., (*4)

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), (*5)

Bootstraps the following collectors for Laravel: - LogCollector: Show all Log messages - SwiftMailCollector and SwiftLogCollector for Mail, (*6)

And the default collectors: - PhpInfoCollector - MessagesCollector - TimeDataCollector (With Booting and Application timing) - MemoryCollector - ExceptionsCollector, (*7)

It also provides a Facade interface for easy logging Messages, Exceptions and Time, (*8)

Installation

Require this package with composer:, (*9)

composer require barryvdh/laravel-debugbar

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider., (*10)

The Debugbar will be enabled when APP_DEBUG is true., (*11)

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

Laravel 5:

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

Barryvdh\Debugbar\ServiceProvider::class,

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

'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), (*15)

Copy the package config to your local config with the publish command:, (*16)

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

Lumen:

For Lumen, register a different Provider in bootstrap/app.php:, (*17)

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

To change the configuration, copy the file to your config folder and enable it:, (*18)

$app->configure('debugbar');

Usage

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

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

And start/stop timing:, (*20)

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:, (*21)

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

There are also helper functions available for the most common calls:, (*22)

// 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:, (*23)

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, (*24)

$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., (*25)

Enabling/Disabling on run time

You can enable or disable the debugbar during run time., (*26)

\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., (*27)

Twig Integration

Laravel Debugbar comes with two Twig Extensions. These are tested with rcrowe/TwigBridge 0.6.x, (*28)

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

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

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., (*30)

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

The Stopwatch extension adds a stopwatch tag similar to the one in Symfony/Silex Twigbridge., (*31)

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

The Versions

27/07 2017

2.4.x-dev

2.4.9999999.9999999-dev

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

25/07 2017

dev-master

9999999-dev

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

  • illuminate/framework 5.5.x

laravel debug profiler debugbar webprofiler

21/07 2017

v2.4.3

2.4.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

11/07 2017

v2.4.2

2.4.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

29/06 2017

1.8.x-dev

1.8.9999999.9999999-dev

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

15/06 2017

v1.8.9

1.8.9.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

14/06 2017

v2.4.1

2.4.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

01/06 2017

v2.4.0

2.4.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

21/02 2017

v1.8.8

1.8.8.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

19/01 2017

v2.3.2

2.3.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

05/01 2017

v2.3.1

2.3.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

10/10 2016

v2.1.4

2.1.4.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

15/09 2016

v2.3.0

2.3.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

29/07 2016

V2.2.3

2.2.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

11/05 2016

v2.2.2

2.2.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

02/05 2016

v2.2.1

2.2.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

16/04 2016

dev-reset

dev-reset

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

17/02 2016

dev-revert-353-1.8

dev-revert-353-1.8

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

17/02 2016

v2.1.3

2.1.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

17/02 2016

v2.2.0

2.2.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

17/02 2016

v2.1.2

2.1.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

11/02 2016

dev-revert-463-master

dev-revert-463-master

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

22/12 2015

v2.1.1

2.1.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

21/12 2015

v2.1.0

2.1.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

09/09 2015

v2.0.6

2.0.6.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

09/07 2015

v2.0.5

2.0.5.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

07/06 2015

v2.0.4

2.0.4.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

26/05 2015

dev-revert-350-fix_query_logging_is_off

dev-revert-350-fix_query_logging_is_off

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

07/03 2015

v2.0.3

2.0.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

19/02 2015

v2.0.2

2.0.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

15/02 2015

v2.0.1

2.0.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

04/02 2015

v1.8.7

1.8.7.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

03/02 2015

v2.0.0

2.0.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

30/01 2015

v1.8.6

1.8.6.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

24/12 2014

v1.8.5

1.8.5.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

04/12 2014

v1.8.4

1.8.4.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

23/11 2014

v1.8.3

1.8.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

18/11 2014

v1.8.2

1.8.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

14/11 2014

v1.8.1

1.8.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

31/10 2014

v1.8.0

1.8.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

15/09 2014

v1.7.7

1.7.7.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

12/09 2014

v1.7.6

1.7.6.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

12/09 2014

v1.7.5

1.7.5.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

08/09 2014

v1.7.4

1.7.4.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

05/09 2014

v1.7.3

1.7.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

04/09 2014

v1.7.2

1.7.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

03/09 2014

v1.7.1

1.7.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

03/09 2014

v1.7.0

1.7.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

27/08 2014

v1.6.8

1.6.8.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

09/08 2014

v1.6.7

1.6.7.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

08/07 2014

v1.6.6

1.6.6.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

24/06 2014

v1.6.5

1.6.5.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

15/06 2014

v1.6.4

1.6.4.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

10/06 2014

v1.6.3

1.6.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

09/06 2014

v1.6.2

1.6.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

01/05 2014

v1.6.1

1.6.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

27/03 2014

v1.6.0

1.6.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

25/03 2014

v1.5.5

1.5.5.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

24/03 2014

v1.5.4

1.5.4.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

23/03 2014

v1.5.3

1.5.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

23/03 2014

v1.5.2

1.5.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

23/03 2014

v1.5.1

1.5.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

19/03 2014

v1.5.0

1.5.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

05/03 2014

v1.4.3

1.4.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

05/03 2014

v1.4.2

1.4.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

05/03 2014

v1.4.1

1.4.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

04/03 2014

v1.4

1.4.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

04/03 2014

v1.3.1

1.3.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

24/02 2014

v1.3

1.3.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

11/02 2014

v1.2.3

1.2.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

04/02 2014

v1.2.2

1.2.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

16/01 2014

v1.2.1

1.2.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

14/01 2014

v1.2

1.2.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

10/01 2014

v1.1.5

1.1.5.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

05/01 2014

v1.1.4

1.1.4.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

02/01 2014

v1.1.3

1.1.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

24/12 2013

v1.1.2

1.1.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

24/12 2013

v1.1.1

1.1.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

24/12 2013

v1.1

1.1.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

17/12 2013

v1.0.4

1.0.4.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

15/12 2013

v1.0.3

1.0.3.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

15/12 2013

v1.0.2

1.0.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

15/12 2013

v1.0.1

1.0.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

15/12 2013

v1.0

1.0.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

02/12 2013

v0.3.2

0.3.2.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

20/11 2013

v0.3.1

0.3.1.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

18/11 2013

v0.3

0.3.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

29/10 2013

v0.2

0.2.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler

25/09 2013

v0.1.0

0.1.0.0

PHP Debugbar integration for Laravel

  Sources   Download

MIT

The Requires

 

laravel debug profiler debugbar webprofiler