dstbtam8732 2018-04-03 10:09
浏览 198
已采纳

Laravel - 读取配置变量

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

In my /config/app.php file: 'pass_domain' => env('PASS_DOMAIN', 'example.com'),

Yet in my middleware located in /app/Http/Middleware/ if I place the following:

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.

Any help?

  • 写回答

1条回答 默认 最新

  • duandi4815 2018-04-03 10:12
    关注

    Try this

    dd(config('app.pass_domain'));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?