Debugbar in Laravel

The purpose of a DebugBar is to integrate in any project and display profiling data from anywhere in that project. It allows you to keep your tabs on your application while working on the development. The DebugBar is one of the important package of Laravel. Laravel Debugbar is easy to install so you can make it run on your system in under five minutes.  First step is to require the package in your Laravel.

composer require barryvdh/laravel-debugbar

Then add the following two lines in your config/app.php file’s providers array and aliases array respectively.

'Barryvdh\Debugbar\ServiceProvider',

'Debugbar' => 'Barryvdh\Debugbar\Facade',

You can view the messages in the DebugBar when you call the facade from the code.

Debugbar::info($object);

Debugbar::error('Error!');

Debugbar::warning('Watch out…');

Debugbar::addMessage('Another message', 'mylabel');

Timeline feature can be used for fixing the bottlenecks in your code. There is an exceptions logger to log exceptions. Another tab in the Debugbar is views. You can view all templates rendered and include all the parameters passed to them. You can see every things like URL, controller, file path etc in the route. Other than these you have Queries, mail and Request, Folder tabs.