ItSolutionStuff.com

How to Enable and Disable Debug Mode in Laravel?

By Hardik Savani • April 16, 2024
Laravel

Hi Developer,

In this tutorial, we will go over the demonstration of how to enable and disable debug mode in laravel. It's a simple example of laravel enable debug mode. you can see laravel disable debug mode. I would like to share with you laravel turn on debug mode.

Laravel provides .env configuration file where you can enable and disable debug mode using APP_DEBUG variable in laravel app. If we have turned on debug mode then as a developer we can easily track the issue and fix it. so, let's see the following ways to on debug mode in laravel project.

You can use this example with laravel 6, laravel 7, laravel 8, laravel 9, laravel 10 and laravel 11 versions.

Enable Debug Mode:

Go it .env file and APP_DEBUG variable value make true for enable debug mode in laravel application.

.env

APP_NAME=Laravel

APP_ENV=local

APP_KEY=

APP_DEBUG=true

APP_URL=http://localhost

Disable Debug Mode:

Go it .env file and APP_DEBUG variable value make false for enable debug mode in laravel application.

.env

APP_NAME=Laravel

APP_ENV=local

APP_KEY=

APP_DEBUG=false

APP_URL=http://localhost

Enable or Disable Mode from app.php:

Go it app.php file and debug variable key value make true or false for enable debug mode in laravel application.

config/app.php : Enable Debug

'debug' => env('APP_DEBUG', true),

config/app.php : Disable Debug

'debug' => env('APP_DEBUG', false),

I hope it can help you...

Tags: Laravel
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

How to Check Running Laravel App Environment?

Read Now →

How to Set Default Value in Laravel Model?

Read Now →

How to Select Specific Columns in Laravel Eloquent Model?

Read Now →

How to Get All Models in Laravel?

Read Now →

How to Get Columns Names from Model in Laravel?

Read Now →

How to Create Model in Laravel using Command?

Read Now →

Laravel Add Custom Configuration File Example

Read Now →

How to Add Custom env Variables in Laravel?

Read Now →

Laravel Replicate Model with Relationships Example

Read Now →

Laravel Livewire Delete Confirmation Example

Read Now →

How to Set Config Value Dynamically in Laravel?

Read Now →

How to Get Config Variable Value in Laravel?

Read Now →