You can install the package via composer:
composer global require fidum/padlock
# Install cpx
composer global require cpx/cpx
# Decrypt
cpx fidum/padlock env:decrypt --env=$ENVIRONMENT --force --key=$ADD_ENCRYPTION_KEY_HERE
# Encrypt
cpx fidum/padlock env:encrypt --env=$ENVIRONMENT --force --key=$ADD_ENCRYPTION_KEY_HERE
$ padlock
USAGE: padlock <command> [options] [arguments]
self-update Allows to self-update a build application
env:decrypt Decrypt an environment file
--key[=KEY] The encryption key
--cipher[=CIPHER] The encryption cipher
--env[=ENV] The environment the command should run under
--force Overwrite the existing environment file
--path[=PATH] Path to write the decrypted file
--filename[=FILENAME] Filename of the decrypted file
env:encrypt Encrypt an environment file
--key[=KEY] The encryption key
--cipher[=CIPHER] The encryption cipher
--env[=ENV] The environment the command should run under
--prune Delete the original environment file
--force Overwrite the existing encrypted environment file
Run the below commands to encrypt and decrypt environment files in the current directory.
Please see the Laravel documentation for environment encryption.
$ padlock env:encrypt --env=testing
INFO Environment successfully encrypted.
Key ................ base64:RR480kEd+Yen6cCMkXmmGUz38cJYwlP/qNctQ7MA6zo=
Cipher ............. AES-256-CBC
Encrypted file ..... .env.testing.encrypted
$ padlock env:decrypt --env=testing --key=base64:RR480kEd+Yen6cCMkXmmGUz38cJYwlP/qNctQ7MA6zo=
INFO Environment successfully decrypted.
Decrypted file ..... .env.testing
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.