farshadth/laravel-dotenv
最新稳定版本:1.1
Composer 安装命令:
composer require farshadth/laravel-dotenv
包简介
This is a package to edit .env file
README 文档
README
Laravel DotEnv is a simple package for editing .env files in Laravel projects. This package allows you to read, edit, or delete values in the .env file. Additionally, you can copy or move the .env file.
Installation
You can install this package via composer:
composer require farshadth/laravel-dotenv
Available Methods
- get()
- getList()
- set()
- setList()
- delete()
- deleteList()
- exists()
- getFileContent()
- getOrSet()
- getAndDelete()
- copyFile()
- moveFile()
- setFilePath()
- getFilePath()
- deleteFile()
- createFile()
Examples
use Farshadth\DotEnv\Facades\DotEnv; DotEnv::get($key); // get multiple keys DotEnv::getList(['key1', 'key2']) DotEnv::set($key, $value); // set multiple keys and values DotEnv::setList([ 'key1' => 'value1', 'key2' => 'value2' ]); DotEnv::delete($key); DotEnv::deleteList(['key1', 'key2']) DotEnv::exists($key); // get the content of the .env file DotEnv::getFileContent(); // get the key and if not exists // set the key and value DotEnv::getOrSet($key, $value); // get the key and delete it DotEnv::getAndDelete($key); // copy the .env file to the new path DotEnv::copyFile($to, $from); // move the .env file to the new path DotEnv::moveFile($to, $from); // set another .env file path to edit that file // instead of the default .env file DotEnv::setFilePath($path); // get the default .env file path, // if another .env file is set it returns that path DotEnv::getFilePath(); // delete the .env file DotEnv::deleteFile($path = null); // create an empty .env file DotEnv::createFile($path);
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-24