dwgebler/encrypted-fields-bundle
Pros:
#[EncryptedField]) mirrors modern PHP/Symfony patterns (e.g., Symfony UX, Doctrine annotations).prePersist, preUpdate, postLoad), hiding complexity from business logic.encryption_key table enables compliance audits (e.g., tracking key usage, rotations).Cons:
encryption_key table migration requires coordination with DBAs and CI/CD pipelines.composer require and migration.laravel-doctrine/orm).gebler_encrypted_fields.yaml with Laravel config).make:migration and gebler:encryption:rotate-key.spatie/laravel-encryption) if Doctrine overhead is prohibitive.pgcrypto could offer native acceleration)..env commits or secrets manager misconfiguration), all per-record keys are compromised.
rotate-key command decrypts/re-encrypts all data, which may be disruptive for large datasets.
encryption_key table migration could conflict with existing schemas or CI/CD pipelines.
composer.json; test upgrades in staging..env files?)AES_ENCRYPT) or application-level encryption (e.g., Laravel’s encrypt) better fit the stack?gebler_encrypted_fields.yaml) and environment variables for master key storage.make:migration, gebler:encryption:rotate-key).ParameterBag for secure master key handling.laravel-doctrine/orm or spatie/laravel-doctrine (~100–200 LOC to adapt)..env and a service provider (~50 LOC).env() helper or a package like vlucas/phpdotenv for master key storage.spatie/laravel-encryption (simpler but less granular).pgcrypto or MySQL’s AES_ENCRYPT.User::creditCardNumber, Patient::ssn).php -m | grep openssl).# Add Flex recipe (optional but recommended)
composer config extra.symfony.endpoint '[{"url": "https://api.github.com/repos/dwgebler/flex-recipes/contents/index.json"}]'
composer require dwgebler/encrypted-fields-bundle
composer require dwgebler/encrypted-fields-bundle laravel-doctrine/orm
php -r "file_put_contents('.env.local', 'ENCRYPTED_FIELDS_KEY='.bin2hex(random_bytes(32)).'\n');"
How can I help you explore Laravel packages today?