LaravelPackages.net
Acme Inc.
Toggle sidebar
xin6841414/laravel-env

一个laravel编辑env文件的小工具

3
0
1.1.1
About xin6841414/laravel-env

xin6841414/laravel-env is a Laravel package for 一个laravel编辑env文件的小工具. It currently has 0 GitHub stars and 3 downloads on Packagist (latest version 1.1.1). Install it with composer require xin6841414/laravel-env. Discover more Laravel packages by xin6841414 or browse all Laravel packages to compare alternatives.

Last updated

LaravelEnv

一个方便后台编辑env文件的小工具

1、安装

    composer require xin6841414/laravel-env -vvv

2、使用

2.1、查询列表

$laravelEnv = app('laravel-env');
$list = $laravelEnv->getFormatData();

// [
//    ['APP_NAME'=>'shagncheng.shoumai365.com'],
//    ['APP_ENV'=>'local']
//        ...
// ]

2.2、获取单个env配置

$num = 10;  //上一步获取到的索引数组的索引键值,
$key = 'APP_NAME'; //配置项键值,$num和$key 不能同时为null,
$value = $laravelEnv->getEnv($num, $key);

2.3、设置env配置

$data = [
    'APP_NAME' => '项目名修改',
    'APP_NAME1' => '项目名追加'
];
$laravelEnv->setEnv($data);

贡献

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. 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.

License

MIT

Comments