March 8th, 2022

Keep your Laravel environment files in sync

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.

Installation

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

Usage

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.

Statamic Ninja

Comments

Marian Pop

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

Subscribe to our newsletter

Get latest news, tutorials, community articles and podcast episodes delivered to your inbox.

Weekly articles
We send a new issue of the newsletter every week on Friday.
No spam
We'll never share your email address and you can opt out at any time.