How to Enable and Disable Debug Mode in Laravel App?

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 and laravel 9 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…

Leave a Comment