Skip to content
Advertisement

How to remove the environment variables from Laravel Debug?

I want to remove the environment variables, database details and the information showing on Laravel Debug.

Here is the screenshot:

Advertisement

Answer

Go to config/app and add the following

 /**
 * Debug Blacklist
 */
'debug_blacklist' => [
    '_COOKIE' => array_keys($_COOKIE),
    '_SERVER' => array_keys($_SERVER),
    '_ENV' => array_keys($_ENV),        
],

it will replace all environment variables value with an asterisks (*******)

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement