Laravel 11 - Install and Configure Laravel Debugbar
In this post, I will show you how to debug laravel 11 using laravel debugbar tool.
The Laravel Debugbar is a very helpful tool for developing with Laravel. It works together with the PHP Debug Bar.
What is Laravel Debugbar?
Laravel Debugbar is a tool for the Laravel framework that helps developers see what's happening inside their web applications. It shows detailed information about database queries, route paths, memory usage, and more on a handy toolbar. This makes debugging and optimizing code easier by providing real-time insights. It’s particularly useful for spotting performance issues and errors during development. You can install it easily via Composer, and it appears at the bottom of your web pages.
Why Use Laravel Debugbar?
Laravel Debugbar helps developers find problems in their code by showing useful details like queries, errors, and memory usage. It's easy to use and shows real-time data, making it quicker to debug and optimize applications. By providing a visual interface, Debugbar simplifies spotting issues and improving performance, which helps in building more efficient and reliable applications. It's like a toolbox that gives instant feedback while you work on your Laravel project.
Here, i will give some steps to install and configure laravel debugbar:
Step 1: Install Laravel 11
This step is not required; however, if you have not created the Laravel app, then you may go ahead and execute the below command:
composer create-project laravel/laravel example-app
Step 2: Install Laravel Debugbar
Here, we will run the following command to install laravel debugbar. so, let's run it:
composer require barryvdh/laravel-debugbar --dev
Step 3: Configure Laravel Debugbar
You can publish basic configuration file using the following command, where you can enable and disable laravel debugbar. so, let's run the following command:
php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider" --tag="config"
You will see the debugbar.php file on config folder. you can modify changes on it.
Step 4: Enable/Disable Laravel Debugbar
You can enable and disable laravel debugbar using .env file. we can use APP_DEBUG variable with true and false value. you can see the below code:
.env
APP_DEBUG=false
You need to cache clear using the following command as well:
php artisan config:cache
You can see the following output of your laravel app:
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- Laravel 11 Pagination with Relationship Example
- How to Upload Files to Amazon S3 in Laravel 11?
- How to Send WhatsApp Messages With Laravel 11?
- Laravel 11 JSON Web Token(JWT) API Authentication Tutorial
- Laravel 11 Update User Profile Tutorial Example
- Laravel 11 PayPal Payment Gateway Integration Example
- Laravel 11 Custom User Login and Registration Tutorial
- Laravel 11 JQuery Load More Data on Scroll Example
- Laravel 11 Notification | Send Notification in Laravel 11
- Laravel 11 User Roles and Permissions Tutorial
- Laravel 11 Livewire Wizard Multi Step Form Tutorial
- Laravel 11 CKeditor Image Upload Example
- Laravel 11 Livewire CRUD using Jetstream & Tailwind CSS