Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mathiasgrimm/laravel-dot-env-gen
generates a .env.gen file based on the existing project source code. Analises for not used .env variables and variables used that are not defined on the .env file
https://github.com/mathiasgrimm/laravel-dot-env-gen
Last synced: 3 months ago
JSON representation
generates a .env.gen file based on the existing project source code. Analises for not used .env variables and variables used that are not defined on the .env file
- Host: GitHub
- URL: https://github.com/mathiasgrimm/laravel-dot-env-gen
- Owner: mathiasgrimm
- Created: 2015-02-11T23:42:26.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-07-22T03:33:50.000Z (over 3 years ago)
- Last Synced: 2024-09-15T23:53:43.644Z (4 months ago)
- Language: PHP
- Size: 376 KB
- Stars: 167
- Watchers: 5
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-laravel-framework - Laravel Dot Env Generator - Generate .env.gen file based on the project source code (Popular Packages)
- laravel-awesome - Laravel Dot Env Generator - Generate .env.gen file based on the project source code (Popular Packages)
README
# Laravel Dot Env Generator
A Laravel 5 command that generates a `.env.gen` file containing all environment
variables defined in `.env` as well as any undefined variables that are being
used throughout the project.# Installation
Install the package using composer:
```bash
composer require mathiasgrimm/laravel-dot-env-gen:dev-master
```Add the service provider:
```php
// config/app.php'providers' => [
...
'MathiasGrimm\LaravelDotEnvGen\DotEnvGenServiceProvider',
...
],
```Add `.env.gen` to your `.gitignore`
## Configuration
You can control which directories are scanned by providing exclusion rules in
the `dotenvgen.php` config file. For a fresh Laravel install, we suggest that
all subdirectories inside `vendor` are ignored except for `vendor/laravel`.Publish the config file:
```bash
php artisan vendor:publish --provider="MathiasGrimm\LaravelDotEnvGen\DotEnvGenServiceProvider" --tag="config"
```Example config:
```php
// config/dotenvgen.php'rules' => [
// Ignores all files inside `vendor` except for those in `vendor/laravel`
'vendor' => ['laravel'],// Ignores the `database/seeds` directory
'database/seeds' => [],
],
```# Usage
From the command line, run `php artisan env:gen`.
A `.env.gen` file will be generated in your project's root folder. Make any
changes you may need, then rename the file to `.env`.Along with generating the `.env.gen` file, the command will notify you if a
defined environment variable is unused as well as alert you if an undefined
environment variable is being used.## Screenshot
![Screenshot](screenshot.png)