你们有谁扩展过 Laravel 的环境变量不?
我现在用的是Json,然后后台可编辑。如果是直接编辑配置文件出错了就完了。后来突然在想 .env 文件不就是一个配置吗?但是我的配置项太多,想独立一个文件。你们有谁知道怎么弄不。
比如说再弄一个.platform.env
你需要部署一个nacos
Laravel使用了 phpdotenv 的composer 包, 自己稍微扩展一下就可以了。
https://github.com/vlucas/phpdotenv
You can then load .env in your application with:
Optionally you can pass in a filename as the second parameter, if you would like to use something other than .env
这个类似你说的那种?https://github.com/xiaoxuan6/laravel-admin...
要确认一下,是环境变量还是业务配置,如果是业务配置,还是建立一个配置表要更好。