Debugbar and IDE Helper — Laravel 10 Discovery Training

In this new chapter we will see two optional tools, but very useful for working with Laravel.

Laravel debug bar

Laravel Debugbar, as the name suggests, will generate a bar that will let you inspect different things about the framework. You will be able to see which part of code took the longest time, errors, different views included by your system, route information, SQL queries, models, etc.

Installation is done through composer.

composer require barryvdh/laravel-debugbar --dev

This installation will automatically configure the framework to display the debug bar when the environment variable APP_DEBUG will be at true.

Laravel ide helper

From the same author, Laravel IDE Helper will generate files for better completion in your editor. The installation is also done through composer.

composer require --dev barryvdh/laravel-ide-helper

You can then use new commands artisan to generate the help files.

php artisan clear-compiled
php artisan ide-helper:generate
php artisan ide-helper:models -M
php artisan ide-helper:meta

You can find more information on the documentation of the tools for the role of these different commands. The most interesting in my opinion is the command ide-helper:models -M because it is what will allow you to document your models to get more details about the properties they contain.


Please enter your comment!
Please enter your name here