-
Notifications
You must be signed in to change notification settings - Fork 80
Installation
In this section:
- Update
- Installation
- Composer require
- Manually
- After installation
- Config
- Views
- Additional middleware
If you had already installed version 1.x, you have to reinstall the package vie the require command. So the old version will be replaced with the new one.
Install the package via the composer require command:
composer require brotzka/laravel-dotenv-editor
In order to always get the latest version of 2.*, you should change the update conditions in your composer.json require section. Change this
"brotzka/laravel-dotenv-editor": "^2.0"
to this
"brotzka/laravel-dotenv-editor": "2.*"
Add the following line to your composer.json require section:
"require": {
//other packages
"brotzka/laravel-dotenv-editor": "2.*"
}
Then run the composer update command:
composer update
Add the following line to your config/app.php
providers:
Brotzka\DotenvEditor\DotenvEditorServiceProvider::class,
Add the following line to your config/app.php
aliases:
'DotenvEditor' => Brotzka\DotenvEditor\DotenvEditorFacade::class,
Finally you have to publish the config file and view via:
php artisan vendor:publish --provider="Brotzka\DotenvEditor\DotenvEditorServiceProvider"
After an Update, maybe you have to force publish:
php artisan vendor:publish --provider="Brotzka\DotenvEditor\DotenvEditorServiceProvider" --force
Be careful, this will overwrite all your published files! It's always better to delete the config/dotenveditor.php
file manually and then run the php artisan vendor:publish
command than to run the force version.
Now you can edit the config file and put in your values.
Open the config/dotenveditor.php and fill it up with your values.
Note: I had an issue where I had to switch the web-middleware between middleware
and middlewareGroups
. In Laravel 5.2, put the web-middleware in the middleware
array. For Laravel 5.1 put it in the middlewareGroups
array.
The path to your .env should not be changed.
If you don't want to use the graphical interface, you could deactivate it in the config.
If you want to add more middlewares to the used routes, you could put them in the arrays.