一个方便后台编辑env文件的小工具
composer require xin6841414/laravel-env -vvv
$laravelEnv = app('laravel-env');
$list = $laravelEnv->getFormatData();
// [
// ['APP_NAME'=>'shagncheng.shoumai365.com'],
// ['APP_ENV'=>'local']
// ...
// ]
$num = 10; //上一步获取到的索引数组的索引键值,
$key = 'APP_NAME'; //配置项键值,$num和$key 不能同时为null,
$value = $laravelEnv->getEnv($num, $key);
$data = [
'APP_NAME' => '项目名修改',
'APP_NAME1' => '项目名追加'
];
$laravelEnv->setEnv($data);
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
MIT