PHPackages                             andrey-helldar/env-sync - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. andrey-helldar/env-sync

Abandoned → [dragon-code/env-sync](/?search=dragon-code%2Fenv-sync)ArchivedLibrary[Framework](/categories/framework)

andrey-helldar/env-sync
=======================

Keeping your .env.example is up-to-date

4.1.0(2y ago)3517.5k1MITPHPPHP ^8.0CI passing

Since Jan 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/TheDragonCode/env-sync)[ Packagist](https://packagist.org/packages/andrey-helldar/env-sync)[ Fund](https://boosty.to/dragon-code)[ Fund](https://www.donationalerts.com/r/dragon_code)[ RSS](/packages/andrey-helldar-env-sync/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (6)Versions (31)Used By (0)

Environment Synchronization
===========================

[](#environment-synchronization)

[![Environment Synchronization](https://camo.githubusercontent.com/6ca5055191af80e6e4cfbbd07cb94113be8de2a511a738dac28d728caf9e1abd/68747470733a2f2f707265766965772e647261676f6e2d636f64652e70726f2f546865447261676f6e436f64652f656e762d73796e632e7376673f6272616e643d706870)](https://camo.githubusercontent.com/6ca5055191af80e6e4cfbbd07cb94113be8de2a511a738dac28d728caf9e1abd/68747470733a2f2f707265766965772e647261676f6e2d636f64652e70726f2f546865447261676f6e436f64652f656e762d73796e632e7376673f6272616e643d706870)

[![Stable Version](https://camo.githubusercontent.com/d98dd331a8c59bf183a19f77d0a97bc791b0352733b44952490fe02fe980f154/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f546865447261676f6e436f64652f656e762d73796e633f6c6162656c3d737461626c65267374796c653d666c61742d737175617265)](https://packagist.org/packages/dragon-code/env-sync)[![Unstable Version](https://camo.githubusercontent.com/85afbac0745eb275d863cee4b1701a70c0e30315d27990b00f1abd553b8761e8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f756e737461626c652d6465762d2d6d61696e2d6f72616e67653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dragon-code/env-sync)[![Total Downloads](https://camo.githubusercontent.com/e4f212c2007bb721c04e277b80e5c8821344574e29c8bb295fc4196835f25c22/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f647261676f6e2d636f64652f656e762d73796e632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dragon-code/env-sync)[![Github Workflow Status](https://camo.githubusercontent.com/f857377a4936e5d651a1643330248d3ea2b3a80f98d1e1216b7ca1bb8b1a9281/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f546865447261676f6e436f64652f656e762d73796e632f73796d666f6e792d362e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/TheDragonCode/env-sync/actions)[![License](https://camo.githubusercontent.com/7c94065dca16ced906e104ce1a0c856ab7b3432f8dd20493621717965e991da4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f647261676f6e2d636f64652f656e762d73796e632e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Tip

Use [msamgan/laravel-env-keys-checker](https://github.com/msamgan/laravel-env-keys-checker) instead.

Installation
------------

[](#installation)

> If you are using the Laravel framework, then install the [dragon-code/env-sync-laravel](https://github.com/TheDragonCode/env-sync-laravel) package instead.

To get the latest version of `Environment Synchronization`, simply require the project using [Composer](https://getcomposer.org):

```
$ composer require dragon-code/env-sync --dev
```

Or manually update `require-dev` block of `composer.json` and run `composer update`.

```
{
    "require-dev": {
        "dragon-code/env-sync": "^4.0"
    }
}
```

How to use
----------

[](#how-to-use)

> This package scans files with `*.php`, `*.json`, `*.yml`, `*.yaml` and `*.twig` extensions in the specified folder, receiving from them calls to the `env` and `getenv` functions. 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.

### Frameworks

[](#frameworks)

- Laravel / Lumen Frameworks - See the documentation in [this repository](https://github.com/TheDragonCode/env-sync-laravel).

### Native using

[](#native-using)

To call a command in your application, you need to do the following:

```
use DragonCode\EnvSync\Services\Syncer;

protected function syncer(): Syncer
{
    return Syncer::make();
}

protected function sync()
{
    $this->syncer()
       ->path(__DIR__)
       ->filename('.env.example')
       ->store();
}
```

If you want to define default values or specify which key values should be stored, you need to pass an array to the constructor of the `Config` class:

```
use DragonCode\EnvSync\Services\Syncer;

protected function syncer(): Syncer
{
    return Syncer::make($this->config());
}

protected function config(): array
{
    return require realpath(__DIR__ . '/your-path/your-config.php');
}
```

You can also suggest your implementation by sending a PR. We will be glad 😊

License
-------

[](#license)

This package is licensed under the [MIT License](LICENSE).

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~41 days

Recently: every ~181 days

Total

29

Last Release

788d ago

Major Versions

v1.4.0 → v2.0.02021-01-30

2.x-dev → v3.0.02021-11-23

v3.4.4 → v4.0.02022-04-20

PHP version history (3 changes)v1.0.0PHP ^7.3|^8.0

v3.1.0PHP ^7.3 || ^8.0

v4.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b77790e612f1c9beed1e1533e36eba4954fbd6da2a5c9f71e845cd0f5465f0ad?d=identicon)[Helldar](/maintainers/Helldar)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (34 commits)")[![andrey-helldar](https://avatars.githubusercontent.com/u/10347617?v=4)](https://github.com/andrey-helldar "andrey-helldar (33 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (30 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![mwkcoding](https://avatars.githubusercontent.com/u/16936030?v=4)](https://github.com/mwkcoding "mwkcoding (1 commits)")

---

Tags

symfonyframeworklaravelenvironmentenvdotenvyii2yiisyncnativedragondragon codeandrey helldar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/andrey-helldar-env-sync/health.svg)

```
[![Health](https://phpackages.com/badges/andrey-helldar-env-sync/health.svg)](https://phpackages.com/packages/andrey-helldar-env-sync)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[dragon-code/support

Support package is a collection of helpers and tools for any project.

238.7M100](/packages/dragon-code-support)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M368](/packages/laravel-zero-framework)[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

240173.5k2](/packages/dragon-code-laravel-deploy-operations)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[dragon-code/laravel-cache

An improved interface for working with cache

6844.8k9](/packages/dragon-code-laravel-cache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
