Registering custom tab to laravel debugbar

In order to register custom tab in laravel debugbar, you need to do following things to make it working properly.

Register your custom tab in AppServiceProvider.php like

\Debugbar::addCollector(new \DebugBar\DataCollector\MessagesCollector('My Custom Tab'));

Now, go to the place where you want to log data in that collector like so

$collector = \Debugbar::getCollector('My Custom Tab');
$collector->addMessage("My custom message", "Name");

And you are done…

You may also like