A Laravel package for easy management of different environments (dev, staging, production, etc.).
highsolutions/laravel-environments is a Laravel package for a laravel package for easy management of different environments (dev, staging, production, etc.)..
It currently has 4 GitHub stars and 11.871 downloads on Packagist (latest version 3.7.0).
Install it with composer require highsolutions/laravel-environments.
Discover more Laravel packages by highsolutions
or browse all Laravel packages to compare alternatives.
Last updated
Easy management of different environments in Laravel projects.

This package can be installed through Composer:
composer require highsolutions/laravel-environments
Or by adding the following line to the require section of your Laravel webapp's composer.json file:
"require": {
"HighSolutions/laravel-environments": "3.*"
}
And run composer update to install the package.
Then, if you are using Laravel <= 5.4, update config/app.php by adding an entry for the service provider:
'providers' => [
// ...
HighSolutions\LaravelEnvironments\EnvironmentServiceProvider::class,
];
Optionally, publish the configuration file if you want to change any defaults:
php artisan vendor:publish --provider="HighSolutions\LaravelEnvironments\EnvironmentServiceProvider"
This will create new file config/environments.php with few configuration options for package.
| Name | Description | Default | |----------------------------------|--------------------------------------------------------------------------------------------|------------------------------------------------------| | path | Path where environments will be stored | environments/ | | files | Files that will be stored for each environment | [ '.env', 'phpunit.xml', 'public/.htaccess', ] | | clear_directory_when_overwriting | If set to true, overwriting environment will be cleared out before putting new files there | false | | keep_existing_file_when_missing | If set to true, existing file in base directory will be not deleted when this file is missing in environment set to active | false |
To create a new environment, just use create method:
php artisan env:create NAME_OF_ENVIRONMENT
In case that another environment exists with the same name, you can force to overwrite it with --overwrite option:
php artisan env:create local --overwrite
You can use also predefined make:env method to be more consistent with other Laravel commands (--overwrite option is enabled here):
php artisan make:env NAME_OF_ENVIRONMENT
To copy files to main codebase, just use set method:
php artisan env:set NAME_OF_ENVIRONMENT
To make a duplicate of existing environment, just use copy method:
php artisan env:copy NAME_OF_EXISTING_ENVIRONMENT NAME_OF_NEW_ENVIRONMENT
In case that another environment exists with the same name, you can force to overwrite it with --overwrite option:
php artisan env:copy old new --overwrite
To remove an environment, just use remove method:
php artisan env:remove NAME_OF_ENVIRONMENT
To see a list of all environments, just use list method:
php artisan env:list
Run the tests with:
vendor/bin/phpunit
3.7.0
3.6.0
3.5.0
3.4.0
3.3.0
3.2.0
3.1.0
3.0.0
2.2.0
config/laravel-environments.php to config/environments.php2.1.0
2.0.0
1.6.0
1.5.0
This package is developed by HighSolutions, software house from Poland in love in Laravel.