php – How to trun off laravel debug mode-ThrowExceptions

Exception or error:

I get this Error in the Log file. The Problem is in the CMS i try to deaktivated the debu-mod. But i dont will turn off.

in the Logs i get this Error-Message and i think thats the reasson why it dont will turn off.

production.ERROR: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘option_id’ cannot be null in /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:449

Tank your for your help 🙂

How to solve:

Set APP_DEBUG=true to APP_DEBUG=false in .env file to turn off debugging messages in production mode.


Laravel Project

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




The amount of error detail your application displays through the browser is controlled by the app.debug configuration option in your config/app.php configuration file. By default, this configuration option is set to respect the APP_DEBUG environment variable, which is stored in your .env file.

1) Local development, you should set the APP_DEBUG environment variable to true.

2) Production environment, this value should always be false.

.env file

APP_DEBUG=false // when you are in the production environment

APP_DEBUG=true // when you are in local development

laravel document

Leave a Reply

Your email address will not be published. Required fields are marked *