我需要在.env
的{{1}}文件中获取常量,
我更改了 Handle.php
Exception/Handler.php
和 env('APP_DEBUG')返回null ,有什么想法吗?
答案 0 :(得分:1)
答案 1 :(得分:0)
As you know you have debug variable in env something like the below:
'debug' => env('APP_DEBUG', false);
Laravel 5+:
then you can access it like $debug = config('app.debug');
Laravel 4.2:
$debug = Config::get('app.debug');
but before going further just check you get the value for it, if you have set value of APP_DEBUG as false in env then you will get 0 but you can't see it while printing so create a condition such as
if (config('app.debug')) {
echo "Yes";
} else {
echo "No";
}
once you get the output you are ready to go further.