andrey-helldar / env-sync-laravel
env-sync package adapter for Laravel framework
Installs: 16 627
Dependents: 0
Suggesters: 0
Security: 0
Stars: 18
Watchers: 2
Forks: 2
Open Issues: 0
pkg:composer/andrey-helldar/env-sync-laravel
Requires
- php: ^7.3 || ^8.0
- dragon-code/env-sync: ^3.4.4 || ^4.0
- illuminate/console: ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
- illuminate/support: ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
Requires (Dev)
- mockery/mockery: ^1.3.1
- orchestra/testbench: ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0
- phpunit/phpunit: ^9.6 || ^10.0
README
Tip
Use msamgan/laravel-env-keys-checker instead.
Installation
To get the latest version of Environment Synchronization, simply require the project using Composer:
$ composer require dragon-code/env-sync-laravel --dev
Or manually update require-dev block of composer.json and run composer update.
{
"require-dev": {
"dragon-code/env-sync-laravel": "^2.0"
}
}
Upgrade from andrey-helldar/env-sync-laravel
- In your
composer.jsonfile, replace"andrey-helldar/env-sync-laravel": "^1.0"with"dragon-code/env-sync-laravel": "^2.0". - Run the
composer updatecommand.
How to use
This package scans files with
*.php,*.json,*.yml,*.yamland*.twigextensions in the specified folder, receiving from them calls to theenvandgetenvfunctions. Based on the received values, the package creates a key-value array. When saving, the keys are split into blocks by the first word before the_character.Also, all keys are sorted alphabetically.
Laravel / Lumen Frameworks
Just execute the php artisan env:sync command.
You can also specify the invocation when executing the composer update command in composer.json file:
{
"scripts": {
"post-update-cmd": [
"php artisan env:sync"
]
}
}
Now, every time you run the composer update command, the environment settings file will be synchronized.
If you want to force the stored values, you can change the configuration file by publishing it with the command:
php artisan vendor:publish --provider="DragonCode\EnvSync\Frameworks\Laravel\ServiceProvider"
Now you can change the file config/env-sync.php.
Native using
See the documentation in the base repository.
License
This package is licensed under the MIT License.