Package Data | |
---|---|
Maintainer Username: | mathiasgrimm |
Maintainer Contact: | mathiasgrimm@gmail.com (Mathias Grimm) |
Package Create Date: | 2015-02-11 |
Package Last Update: | 2021-07-22 |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2024-11-26 15:13:30 |
Package Statistics | |
---|---|
Total Downloads: | 80,062 |
Monthly Downloads: | 458 |
Daily Downloads: | 7 |
Total Stars: | 167 |
Total Watchers: | 5 |
Total Forks: | 8 |
Total Open Issues: | 5 |
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.
Install the package using composer:
composer require mathiasgrimm/laravel-dot-env-gen:dev-master
Add the service provider:
// config/app.php
'providers' => [
...
'MathiasGrimm\LaravelDotEnvGen\DotEnvGenServiceProvider',
...
],
Add .env.gen
to your .gitignore
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:
php artisan vendor:publish --provider="MathiasGrimm\LaravelDotEnvGen\DotEnvGenServiceProvider" --tag="config"
Example config:
// config/dotenvgen.php
'rules' => [
// Ignores all files inside `vendor` except for those in `vendor/laravel`
'vendor' => ['laravel'],
// Ignores the `database/seeds` directory
'database/seeds' => [],
],
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.