laravel 5.2 配置常量在服务器上不起作用

laravel 5.2 config constant does not work on server

我将我的字符串分开,并将它们放在 textConstant.php 文件的 Constant 目录中,在我的本地主机中一切正常,但是当我将我的代码上传到我的服务器时,字符串淡出并且屏幕上没有任何显示,

这是我的常量文件:

return [
        'title' => 'test',
         'book' => 'book_test',
       ];

这是我使用常量的代码:

  <button>{{config('Constants.textConstant.book')}}</button>

请帮助我解决我的问题,因为我的网站无法使用,非常感谢:)

如果您启用了缓存,请尝试通过命令行 运行 以下代码。

php artisan config:clear
php artisan config:cache.

在CMD中; 先写

php artisan config:clear

然后

php artisan config:cache

希望这会奏效。