简体   繁体   English

laravel配置文件在配置文件夹中重新设置为null

[英]laravel config file retun null in config folder

I have a config file called fcm.php in config folder in laravel. 我在laravelconfig文件夹中有一个名为fcm.php配置文件。 The file looks like this: 该文件如下所示:

<?php
return [
    'driver' => env('FCM_PROTOCOL', 'http'),
    'log_enabled' => true,

    'http' => [
        'server_key' => config('app.fcm_mode') == 'user' ? env('FCM_SERVER_KEY', 'Your FCM server key') : env('FCM_DELIVERY_SERVER_KEY', 'Your FCM server key'),
        'sender_id' => config('app.fcm_mode') == 'user' ? env('FCM_SENDER_ID', 'Your sender id') : env('FCM_DELIVERY_SENDER_ID', 'Your sender id'),
        'server_send_url' => 'https://fcm.googleapis.com/fcm/send',
        'server_group_url' => 'https://android.googleapis.com/gcm/notification',
        'timeout' => 30.0, // in second
    ],
];

It works properly in my localhost(I vendor:publish fcm.php config file), But in a shared host, config('app') return null in this file(config/fcm.php) 它在我的本地主机(我的供应商:发布fcm.php配置文件)中正常工作,但是在共享主机中,config('app')在此文件(config / fcm.php)中返回null。

What is the problem? 问题是什么? Thanks 谢谢

尝试通过以下方式访问它:

config('fcm.log_enabled')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM