
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
IMYMI, yesterday we released a brand new #Laravel package called Envy 📦
— Luke Downing (@LukeDowning19) February 10, 2022
Its purpose is to scan your project and keep track of missing or outdated environment variables based on your config files 👌https://t.co/730aLIP9Wc
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.

Comments

Marian Pop
marian@laravelmagazine.comPHP / Laravel Developer. Writing and maintaining @LaravelMagazine. Host of "The Laravel Magazine Podcast". Pronouns: vi/vim.