March 8th, 2022


Keep your Laravel environment files in sync

Envy is a tool that makes syncing environment files with your Laravel project a breeze. You can maintain everything up to date by syncing your environment files with your project setup with a simple Artisan command.

Envy was released by Luke Downing and the team at Worksome

The problem it solves

If you found yourself spending hours debugging because your project's .env.example was out of date then you see the value Envy brings to your project and workflow in general.


You can install the package via composer:

1composer require worksome/envy --dev

You can then publish the config file so that you can fine-tune Envy to your project's needs. You can do that by using the following command:

1php artisan envy:install


Envy ships with two artisan commands:

1php artisan envy:sync

This commands is looking in the project's config files for calls to Laravel's .env method. Once found, it will compare them with your existing .env.example for any missing entries. You will be then given the choice to either add the missing keys to env.example file or add the missing keys to Envy's exclusion list.

1php artisan envy:prune

This command will scan your .env.example file for entries that could not be found in your project's config files. If any additional entries are found you will have to choice to either remove the additional entries from your environment file or add the missing keys to Envy's inclusion list.

For more details and configuration options we recommend reading Luke's release blog post where he's explaining everything in detail as well as checking out the github repo where you can find all of the avialable artisan commands that Envy ships with, flags you can use for the available artisan commands and more.

fathom analytics Follow @LaravelMagazine on Twitter →


Marian Pop

PHP / Laravel Developer. Writing and maintaining @LaravelMagazine. Host of "The Laravel Magazine Podcast". Pronouns: vi/vim.


Get latest news, tutorials, community articles and podcast episodes delivered to your inbox every Friday!

We'll never share your email address and you can opt out at any time.