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.