How to Monitor Laravel Performance with Laravel Debugbar

How to Monitor Laravel Performance with Laravel Debugbar
Hello everyone, back again at porkaone. Laravel debugbar is a package or library that can help you a lot. This library is made by barry vd. Heuvel, this package makes it easy for you to monitor the performance of your application during development. With easy installation and sophisticated features, this package can be one of the recommended packages to be installed for the first time.

Debugbar has been around since Laravel 5 and until now it is still available for advanced Laravel versions. Here's how to install and what features are included in this great package

How to Install Laravel Debugbar

1. Run the command below to install Laravel debugbar
composer require barryvdh/laravel-debugbar --dev

2. Anda make sure APP_DEBUG = true in file .env

3. Next, the debugbar package will automatically appear in the lower right corner of your Laravel project. The installation method is quite easy and simple.

Laravel Debugbar
Laravel Debugbar View

When the application has been published to the internet and is ready to use.You can turn off the Laravel debugbar by changing APP_DEBUG to false.

Fitur Laravel Debugbar

🚀 Timeline

This timeline feature really helps you in measuring how quickly the application is executed. With this view you can increase or improve the speed of the application.
Laravel Timeline

🚀 Views

All blade templates that you use in one route will be displayed along with all their parameters
Views Debugbar

🚀 Route

You can see the request method, middlewarem controller, file, and namespace. All this route information is available in one tab

🚀 Queries

All the queries you use will be displayed here. This allows you to see the number of queries used and the duration each query was executed for. With information like this, you can reduce and optimize query usage so that page loads get better.
Queries Debugbar

🚀 Models

The models tab will display which models are used and how many times they are used on a page

Models Debugbar

🚀 Session

Session tab is used to display all session data. You can use session data as a substitute for certain queries where the data is not too much and is used consistently on each page.
Session Debugbar

🚀 Request

This tab will show all request and response type in details

Request Debugbar

Apart from the tabs described above, you can also see a summary of other information such as

1. route name and request method

2. the size of the memory used

3. the duration of the page request

4.php version

There are still some other advanced features that I haven't explained above, because I often use some of the features above. You can find out more information at the following link

So many articles this time about how to monitor Laravel performance with the Laravel debugbar. Hope it is useful. If you have something to ask, please ask directly in the comments column below. That is all and thank you.

Post a Comment