ItSolutionStuff.com

Laravel 11 - Install and Configure Laravel Debugbar

By Hardik Savani β€’ September 4, 2024
Laravel

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

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

πŸ“Ί Subscribe on YouTube

We Are Recommending You

β˜…

Laravel 11 Pagination with Relationship Example

Read Now β†’
β˜…

How to Upload Files to Amazon S3 in Laravel 11?

Read Now β†’
β˜…

How to Send WhatsApp Messages With Laravel 11?

Read Now β†’
β˜…

Laravel 11 JSON Web Token(JWT) API Authentication Tutorial

Read Now β†’
β˜…

Laravel 11 Update User Profile Tutorial Example

Read Now β†’
β˜…

Laravel 11 PayPal Payment Gateway Integration Example

Read Now β†’
β˜…

Laravel 11 Custom User Login and Registration Tutorial

Read Now β†’
β˜…

Laravel 11 JQuery Load More Data on Scroll Example

Read Now β†’
β˜…

Laravel 11 Notification | Send Notification in Laravel 11

Read Now β†’
β˜…

Laravel 11 User Roles and Permissions Tutorial

Read Now β†’
β˜…

Laravel 11 Livewire Wizard Multi Step Form Tutorial

Read Now β†’
β˜…

Laravel 11 CKeditor Image Upload Example

Read Now β†’
β˜…

Laravel 11 Livewire CRUD using Jetstream & Tailwind CSS

Read Now β†’