How to hide .env passwords in Laravel whoops output?

后端 未结 10 1661
攒了一身酷
攒了一身酷 2020-12-07 10:48

How can I hide my passwords and other sensitive environment variables on-screen in Laravel\'s whoops output?

Sometimes other people are looking at my development wor

10条回答
  •  心在旅途
    2020-12-07 10:54

    For Laravel 5.6-5.8:

    'debug_blacklist' => [
        '_COOKIE'   => array_keys(array_filter($_COOKIE, function($value) {return is_string($value);})),
        '_SERVER'   => array_keys(array_filter($_SERVER, function($value) {return is_string($value);})),
        '_ENV'      => array_keys(array_filter($_ENV, function($value) {return is_string($value);})),
    ],
    

提交回复
热议问题