gpt4 book ai didi

laravel - 将 laravel 5.1 升级到 5.2\App::environment() 后始终返回 "production"

转载 作者:行者123 更新时间:2023-12-02 08:43:28 25 4
gpt4 key购买 nike

我将 laravel 5.1 升级到 5.2,一切看起来都很好。但是当尝试访问应用程序环境时没有得到预期的结果。

When i dd($_ENV) this is what i get 
"APP_ENV" => "vagrant"
"APP_DEBUG" => "true"
"DB_HOST" => "localhost"

But When dd(\App::environment());
"production"

P.S. even I checked in tinker: dd(env('APP_ENV')) gives me "vagrant"
but dd(\App::environment()) gives me "production".
Dont you think it is odd :(

这很奇怪:(

有人遇到这个问题吗?

最佳答案

您错过了升级过程中的一个步骤:

Configuration

Environment Value

Add an env configuration option to your app.php configuration file that looks like the following:

'env' => env('APP_ENV', 'production'),

附注您可以通过 artisan 命令检查该值:

php artisan env

关于laravel - 将 laravel 5.1 升级到 5.2\App::environment() 后始终返回 "production",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34499032/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com