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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners