Kritim Yantra
May 13, 2025
If you're a Laravel developer (especially a beginner), you've probably run into situations where your app doesn't behave the way you expect. Maybe a query is too slow, or a route isn’t returning the right view. What if you had a magical tool that gave you real-time insights about what's going on behind the scenes in your Laravel app?
Say hello to Laravel Debugbar.
Laravel Debugbar is a powerful package that adds a developer toolbar to your Laravel applications. It shows detailed information about your requests, routes, queries, views, session data, and much more — all beautifully displayed right in your browser.
It’s like having X-ray vision for your Laravel code.
Getting started is easy. Here’s how you can install it:
composer require barryvdh/laravel-debugbar --dev
The --dev
flag means it will only be installed in your local environment — not in production. That’s perfect because you don’t want users seeing your internal data.
Once installed, Laravel will automatically detect it (thanks to Laravel’s package discovery), and you're ready to go!
If it doesn't start showing up, you can publish the config like this:
php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"
This will create a config/debugbar.php
file where you can tweak settings.
Once you refresh your app in the browser, you’ll see a little black bar at the bottom. That’s your new best friend!
Here’s what it can do:
See which route was matched and what controller handled it.
Shows all SQL queries run on the page, including:
Shows how much memory your request consumed.
Inspect session values, request inputs, headers, and more.
See which Blade templates were used and how much time each one took to render.
If your app uses Ajax, Debugbar tracks those too — super helpful!
Laravel Debugbar is perfect when:
Remember, never use Debugbar in production. It can expose sensitive information and slow down your app. That’s why it’s only meant for development.
You can disable it easily:
// In .env file
DEBUGBAR_ENABLED=false
You can even add your own timers like this:
\Debugbar::startMeasure('custom-process', 'My Custom Process');
// Your code here...
\Debugbar::stopMeasure('custom-process');
This is great for timing specific pieces of code.
Laravel Debugbar is a must-have tool for every Laravel developer. Whether you're building a small app or a large-scale platform, it helps you see the invisible and solve problems faster.
So if you haven’t already, install it now and explore your app like never before.
Happy debugging! 🐞💻
If you’re new to Laravel or Laravel Debugbar and something feels confusing, don’t hesitate to ask in the comments. Learning is a journey, and tools like Debugbar make that journey a lot smoother.
No comments yet. Be the first to comment!
Please log in to post a comment:
Sign in with Google