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

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'));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
  • ¥15 NX MCD仿真与博途通讯不了啥情况
  • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
  • ¥15 gradio的web端页面格式不对的问题
  • ¥15 求大家看看Nonce如何配置
  • ¥15 Matlab怎么求解含参的二重积分?
  • ¥15 苹果手机突然连不上wifi了?
  • ¥15 cgictest.cgi文件无法访问