1
myconfig.php是否允许使用嵌套键访问Laravel配置值?
return [
'key1' => [
'nested_key1' => 1,
'nested_key2' => 2
],
'key2' => [
'nested_key1' => 1,
'nested_key2' => 2
]
];
所以我在我的config
目录中的自定义配置。是否可以设置这样的值:config(['myconfig.key1.nested_key1' => 3])
?我可以通过这种方式读取值,但似乎在设置新值时不起作用。
所以要改变文件中的值我需要使用第三方解决方案? –
@AndrewVershinin如果你想保存下一个请求的值,是的,你应该使用一个像['Laravel Config Writer'](https://github.com/daftspunk/laravel-config-writer) –