Skip to content

Commit be51ce0

Browse files
committed
🎉 Initial commit
0 parents  commit be51ce0

12 files changed

+431
-0
lines changed

‎.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

‎.gitattributes

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.travis.yml export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/.scrutinizer.yml export-ignore
10+
/tests export-ignore
11+
/.editorconfig export-ignore

‎.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
build
2+
composer.lock
3+
docs
4+
vendor
5+
coverage
6+
SCRATCH.md

‎.scrutinizer.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
filter:
2+
excluded_paths: [tests/*]
3+
4+
checks:
5+
php:
6+
remove_extra_empty_lines: true
7+
remove_php_closing_tag: true
8+
remove_trailing_whitespace: true
9+
fix_use_statements:
10+
remove_unused: true
11+
preserve_multiple: false
12+
preserve_blanklines: true
13+
order_alphabetically: true
14+
fix_php_opening_tag: true
15+
fix_linefeed: true
16+
fix_line_ending: true
17+
fix_identation_4spaces: true
18+
fix_doc_comments: true

‎.styleci.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
preset: laravel
2+
3+
disabled:
4+
- single_class_element_per_statement
5+
- self_accessor

‎CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
All notable changes to `laravel-env-set-command` will be documented in this file
4+
5+
## 1.0.0 - 2018-07-13
6+
7+
- Initial release

‎CONTRIBUTING.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
Please read and understand the contribution guide before creating an issue or pull request.
6+
7+
## Etiquette
8+
9+
This project is open source, and as such, the maintainers give their free time to build and maintain the source code held within. They make the code freely available in the hope that it will be of use to other developers. It would be extremely unfair for them to suffer abuse or anger for their hard work.
10+
11+
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the world that developers are civilized and selfless people.
12+
13+
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient quality to benefit the project. Many developers have different skill sets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
14+
15+
## Viability
16+
17+
When requesting or submitting new features, first consider whether it might be useful to others. Open source projects are used by many developers, who may have entirely different needs to your own. Think about whether or not your feature is likely to be used by other users of the project.
18+
19+
## Procedure
20+
21+
Before filing an issue:
22+
23+
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
24+
- Check to make sure your feature suggestion isn't already present within the project.
25+
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
26+
- Check the pull requests tab to ensure that the feature isn't already in progress.
27+
28+
Before submitting a pull request:
29+
30+
- Check the codebase to ensure that your feature doesn't already exist.
31+
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
32+
33+
## Requirements
34+
35+
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).
36+
37+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
38+
39+
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
40+
41+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.
42+
43+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
44+
45+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
46+
47+
**Happy coding**!

‎LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Liam Hammett <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

‎README.md

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Laravel `set:env` Command
2+
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/imliam/laravel-env-set-command.svg)](https://packagist.org/packages/imliam/laravel-env-set-command)
4+
[![Total Downloads](https://img.shields.io/packagist/dt/imliam/laravel-env-set-command.svg)](https://packagist.org/packages/imliam/laravel-env-set-command)
5+
[![License](https://img.shields.io/github/license/imliam/laravel-env-set-command.svg)](LICENSE.md)
6+
7+
Set a .env file variable from the command line.
8+
9+
<!-- TOC -->
10+
11+
- [Laravel `set:env` Command](#laravel-setenv-command)
12+
- [Installation](#installation)
13+
- [Usage](#usage)
14+
- [Changelog](#changelog)
15+
- [Contributing](#contributing)
16+
- [Security](#security)
17+
- [Credits](#credits)
18+
- [License](#license)
19+
20+
<!-- /TOC -->
21+
22+
## Installation
23+
24+
You can install the package with [Composer](https://getcomposer.org/) using the following command:
25+
26+
```bash
27+
composer require imliam/laravel-env-set-command:^1.0.0
28+
```
29+
30+
## Usage
31+
32+
When running the `env:set` artisan command, you must provide both a key and value as two arguments.
33+
34+
```bash
35+
$ php artisan env:set app_name Example
36+
# Environment variable with key 'APP_NAME' has been changed from 'Laravel' to 'Example'
37+
```
38+
39+
You can also set values with spaces by wrapping them in quotes.
40+
41+
```bash
42+
$ php artisan env:set app_name "Example App"
43+
# Environment variable with key 'APP_NAME' has been changed from 'Laravel' to '"Example App"'
44+
```
45+
46+
The command will also create new environment variables if an existing one does not exist.
47+
48+
```bash
49+
$ php artisan env:set editor=vscode
50+
# Environment variable with key 'EDITOR' has been set to 'vscode'
51+
```
52+
53+
Instead of two arguments split by a space, you can also mimic the `.env` file format by supplying `KEY=VALUE`.
54+
55+
```bash
56+
$ php artisan env:set app_name=Example
57+
# Environment variable with key 'APP_NAME' has been changed from 'Laravel' to 'Example'
58+
```
59+
60+
The command will do its best to stop any invalid inputs.
61+
62+
```bash
63+
$ php artisan env:set @pp_n@me Laravel
64+
# Invalid environment key. Only use letters and underscores
65+
```
66+
67+
## Changelog
68+
69+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
70+
71+
## Contributing
72+
73+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
74+
75+
### Security
76+
77+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
78+
79+
## Credits
80+
81+
- [Liam Hammett](https://github.com/imliam)
82+
- [All Contributors](../../contributors)
83+
84+
## License
85+
86+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

‎composer.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "imliam/laravel-env-set-command",
3+
"description": "Set a .env file variable from the command line",
4+
"keywords": [
5+
"imliam",
6+
"laravel-env-set-command",
7+
"environment",
8+
"variables",
9+
"env",
10+
"artisan"
11+
],
12+
"homepage": "https://github.com/imliam/laravel-env-set-command",
13+
"license": "MIT",
14+
"authors": [
15+
{
16+
"name": "Liam Hammett",
17+
"email": "[email protected]",
18+
"homepage": "https://liamhammett.com",
19+
"role": "Developer"
20+
}
21+
],
22+
"require": {
23+
"php": "^7.1"
24+
},
25+
"autoload": {
26+
"psr-4": {
27+
"ImLiam\\EnvironmentSetCommand\\": "src"
28+
}
29+
},
30+
"config": {
31+
"sort-packages": true
32+
},
33+
"extra": {
34+
"laravel": {
35+
"providers": [
36+
"ImLiam\\EnvironmentSetCommand\\EnvironmentSetCommandServiceProvider"
37+
]
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)