PHPackages                             fragly/laravel-envsync - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. fragly/laravel-envsync

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

fragly/laravel-envsync
======================

A Laravel package that compares and syncs your .env with .env.example for safer CI/CD environments.

v1.0.0(6mo ago)01MITPHPPHP ^8.2

Since Oct 25Pushed 6mo agoCompare

[ Source](https://github.com/cristalNichita/laravel-envsync)[ Packagist](https://packagist.org/packages/fragly/laravel-envsync)[ RSS](/packages/fragly-laravel-envsync/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

⚙️ Laravel EnvSync
==================

[](#️-laravel-envsync)

[![Packagist Version](https://camo.githubusercontent.com/7bcfcfaa3528649b76b1647ad8d199abac831a48a32f2f62dc4fd4cd9d2c39fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667261676c792f6c61726176656c2d656e7673796e632e7376673f636f6c6f723d627269676874677265656e)](https://packagist.org/packages/fragly/laravel-envsync)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![Laravel](https://camo.githubusercontent.com/36ab9eb40d419c375ec1c19e6d5fd0d5ae0aeb01372cc6b164966c412feecdad/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302532422d7265642e737667)](https://laravel.com)[![Downloads](https://camo.githubusercontent.com/b93cfffe036d00b059834d2b171fad162f4a799f794853f2874be39038909462/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667261676c792f6c61726176656c2d73656375726974792d746f6f6c732e7376673f636f6c6f723d627269676874677265656e)](https://packagist.org/packages/fragly/laravel-envsync)[![License](https://camo.githubusercontent.com/a7cbf3bd9e3cd3b86b6903c2b658e3dc4f092f611933a96d8139c378fef37cac/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6372697374616c4e6963686974612f6c61726176656c2d656e7673796e632e737667)](https://github.com/cristalNichita/laravel-envsync/blob/main/LICENSE)[![Sponsor](https://camo.githubusercontent.com/9e426f5cf6f1022ee8a2c1e21e8616cf0934f2300e537546b444ce13a6278a68/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d50617472656f6e2d6666343234643f6c6f676f3d70617472656f6e)](https://www.patreon.com/c/FraglyDev)

> Compare and safely synchronize your `.env` with `.env.example`.
> Perfect for **CI/CD pipelines**, **team development**, and **clean environments**.

Contents
--------

[](#contents)

- [Features](#-features)
- [Installation](#-installation)
- [Usage](#-usage)
- [Example workflow (CI/CD)](#-example-workflow-cicd)
- [Configuration](#-configuration)
- [Local development (testing the package)](#-local-development-testing-the-package)
- [About the Author](#-about-the-author)
- [License](#-license)

🚀 Features
----------

[](#-features)

✅ Compares `.env.example` ↔ `.env`
✅ Shows **missing**, **extra**, and **same-as-default** variables
✅ Auto-syncs `.env` with `.env.example`
✅ Makes safe **backups** before changes
✅ Ignores keys or patterns (`APP_KEY`, `LOG_*`, etc.)
✅ Perfect for automation (non-interactive mode for CI)

---

🧩 Installation
--------------

[](#-installation)

```
composer require fragly/laravel-envsync --dev
```

The serviceprovider is auto-discovered by Laravel.

🧠 Usage
-------

[](#-usage)

### 🔍 Compare

[](#-compare)

```
php artisan env:diff
```

### Example output:

[](#example-output)

```
> Checking .env consistency
! Missing in .env:
+ MAIL_ENCRYPTION
+ REDIS_PASSWORD

>> Extra in .env:
+ OLD_DEBUG_FLAG

!! Same-as-default values (check you configured them):
+ APP_NAME
+ APP_ENV
+ APP_DEBUG

Summary: missing=2, extra=1, same-as-default=3

```

### JSON output (for CI)

[](#json-output-for-ci)

```
php artisan env:diff --json
```

### Filter or hide sections

[](#filter-or-hide-sections)

```
php artisan env:diff --only=missing
php artisan env:diff --hide-defaults
php artisan env:diff --ignore=APP_KEY,LOG_*,REDIS_*
```

### 🔄 Sync

[](#-sync)

Synchronize .env with .env.example.

```
php artisan env:sync
```

### Options

[](#options)

OptionDescription`--empty`Add missing variables with empty values instead of defaults`--prune`Remove keys not present in `.env.example``--no-backup`Skip creating `.env.bak.*` backup`--yes`Non-interactive (for CI/CD)`--json`Output result in JSON`--ignore=`Comma-separated ignore list (same syntax as `env:diff`)### Example

[](#example)

```
php artisan env:sync --prune --yes --ignore=APP_KEY,LOG_*
```

🧰 Example workflow (CI/CD)
--------------------------

[](#-example-workflow-cicd)

In your pipeline:

```
composer install
php artisan env:sync --yes --prune
php artisan config:cache
```

Keeps environment variables always in sync automatically

⚙️ Configuration
----------------

[](#️-configuration)

You can create `.envsyncignore` file in the project root to store patterns ignored in both commands:

```
APP_KEY
LOG_*
MAIL_*
REDIS_*

```

🧪 Local development (testing the package)
-----------------------------------------

[](#-local-development-testing-the-package)

If you want to test this package locally without publishing to Packagist:

```
// in your project's composer.json
{
  "repositories": [
    {
      "type": "path",
      "url": "../package-destination"
    }
  ]
}
```

Then install it:

```
composer require fragly/laravel-envsync:@dev
```

Composer will symlink your package for instant updates.

🧑‍💻 About the Author
--------------------

[](#‍-about-the-author)

Fragly Dev — Building tools for modern Laravel &amp; Next.js developers. Follow for more developer utilities, security helpers, and SaaS-ready boilerplates.

📜 License
---------

[](#-license)

This package is open-sourced software licensed under the MIT license.

---

🔍 SEO Keywordslaravel env sync, laravel .env compare, laravel .env validator, laravel .env example check,
laravel environment sync, laravel environment tool, laravel environment manager,
laravel ci cd tools, laravel devops utilities, laravel config checker,
laravel configuration sync, laravel dotenv helper, laravel dotenv checker,
laravel deployment tools, laravel config diff, laravel config audit,
laravel .env fixer, laravel production best practices,
laravel environment consistency, laravel config manager, laravel dotenv sync,
laravel automation tools, laravel artisan env command, fragly env sync, fragly laravel package

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance66

Regular maintenance activity

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

203d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35386c64c66e4e25c7b4c63c365aeb98f77e3d9564e73c581990639efa4e7039?d=identicon)[FraglyDev](/maintainers/FraglyDev)

---

Tags

laravelconfigurationenvironmentdevopsenvdotenvsyncci-cdconfig-diff

### Embed Badge

![Health badge](/badges/fragly-laravel-envsync/health.svg)

```
[![Health](https://phpackages.com/badges/fragly-laravel-envsync/health.svg)](https://phpackages.com/packages/fragly-laravel-envsync)
```

###  Alternatives

[downtoworld/laravel-devops

Laravel Cloudflare-Tunnels Ready Production Docker-Compose

161.1k](/packages/downtoworld-laravel-devops)

PHPackages © 2026

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