How to Enable and Disable Debug Mode in 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...
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
- How to Check Running Laravel App Environment?
- How to Set Default Value in Laravel Model?
- How to Select Specific Columns in Laravel Eloquent Model?
- How to Get All Models in Laravel?
- How to Get Columns Names from Model in Laravel?
- How to Create Model in Laravel using Command?
- Laravel Add Custom Configuration File Example
- How to Add Custom env Variables in Laravel?
- Laravel Replicate Model with Relationships Example
- Laravel Livewire Delete Confirmation Example
- How to Set Config Value Dynamically in Laravel?
- How to Get Config Variable Value in Laravel?