【发布时间】:2020-01-08 08:40:22
【问题描述】:
我正在寻找一种写入 laravel 5 配置文件的方法,比使用旧的 str_replace 更清洁、更简单。
laravel 有 4 种解决方案: How to edit and save custom config files in Laravel? 和: https://github.com/daftspunk/laravel-config-writer
但这在 laravel 5 中不起作用。
【问题讨论】:
-
那些提供的解决方案中哪些不起作用?是否遇到错误,没有更新文件?
-
这些解决方案不适用于 laravel 5。Laravel 5 有其他方法签名。 FileLoader 现在不在 Config 命名空间下,而是在
Translation下。 config/Repository 有其他构造函数参数等。 -
我目前使用的解决方案:在ioc容器中设置runtime的设置。