sven / flex-env
直接从命令行编辑Laravel的.env文件。
v2.2.2
2022-12-21 18:52 UTC
Requires
- php: ^7.2 || ^8.0
- illuminate/support: ^6.0 || ^7.0 || ^8.0
- laravel/framework: ^6.0 || ^7.0 || ^8.0
Requires (Dev)
README
Laravel FlexEnv
此包添加了一些有用的命令,可以直接从命令行通过简单易读的API编辑Laravel的.env文件。再也不用碰鼠标了!
安装
通过composer
$ composer require sven/flex-env --dev
或者,将包添加到你的开发依赖中composer.json
,然后运行composer update
{ "require-dev": { "sven/flex-env": "^2.0" } }
注意:如果你使用的是Laravel 5.5,那么你就完成了!由于自动发现,服务提供者已经自动注册到容器中。
接下来,将FlexEnvServiceProvider
添加到你的config/app.php
中的providers
数组中
// config/app.php 'providers' => [ ... Sven\FlexEnv\FlexEnvServiceProvider::class, ]
用法
这个包中的命令现在应该已经注册了。只需运行php artisan
,你将在列表中看到它们。
# Create or edit an entry in your .env file: $ php artisan env:set {key} {value} [--line-break|-L] # Add the --line-break (or -L) option to insert a line break before the entry.
# Delete an entry from your .env file:
$ php artisan env:delete {key}
# Show the value of the given key from your .env file:
$ php artisan env:get {key}
# Show the entire .env file:
$ php artisan env:list
你做出的所有更改现在都应反映在您的.env
文件中。
灵感
此包的灵感来源于LeShadow的ArtisanExtended。
贡献
欢迎所有贡献(pull请求、问题报告和功能请求)。不过,请先阅读CONTRIBUTING.md。查看贡献者页面,了解所有贡献者。
许可证
sven/flex-env
采用MIT许可证(MIT)。有关更多信息,请参阅许可证文件。