How to Enable and Disable Debug Mode in Laravel App?
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.
Disable Debug Mode:
Go it .env file and APP_DEBUG variable value make false for enable debug mode in laravel application.
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...
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?