Laravel v9.32.0 brought the release of two new Artisan commands: env:encrypt and env:decrypt. These commands make it possible to securely store an encrypted copy of your application's environment file in source control, making it a living part of your application.

The env:decrypt command decrypts the encrypted environment file and writes it back to its typical location. The decryption key must be provided to the command via the --key option: php artisan env:decrypt --key="3UVsEgGVK36XN82KKeyLFMhvosbZN1aF"

After running the env:encrypt command, you will find an encrypted equivalent of your production environment file named.env.production.encrypted at the root of your project.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners