[英]Laravel - reading config variable
I don't get it - when I search for this problem I get told to do the followng: 我不明白-当我搜索此问题时,我被告知要执行以下操作:
composer dump-autoload php artisan config:clear php artisan cache:clear php artisan view:clear
And yet it is not making a difference. 但这并没有改变。 In my
.env
file: PASS_DOMAIN=domain.local
在我的
.env
文件中: PASS_DOMAIN=domain.local
In my /config/app.php
file: 'pass_domain' => env('PASS_DOMAIN', 'example.com'),
在我的
/config/app.php
文件中: 'pass_domain' => env('PASS_DOMAIN', 'example.com'),
Yet in my middleware located in /app/Http/Middleware/
if I place the following: 但是如果放置在
/app/Http/Middleware/
放置以下内容:
dd(config('pass_domain'));
I get nothing. 我什么都没有。 Why cant I access this variable?
为什么我不能访问该变量? Originally I had
env('pass_domain')
but nothing is letting me see this damn variable. 最初我有
env('pass_domain')
但是没有什么让我看到这个该死的变量。
Any help? 有什么帮助吗?
尝试这个
dd(config('app.pass_domain'));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.