google/cloud-kms
Official Google Cloud PHP client for Cloud Key Management Service (KMS). Create and manage key rings and cryptographic keys, encrypt and decrypt data, sign and verify payloads, and control access with IAM policies from PHP applications.
Architecture fit
Encrypter for bulk data.openssl/Encrypter does the actual bulk crypto locally. That keeps KMS calls off the hot path and fits the existing Eloquent casts and Crypt facade mental model.Integration feasibility
google/cloud-kms plus google/gax, google/protobuf, google/common-protos, and guzzlehttp/guzzle for REST transport). No PHP extension is strictly required if you pin the REST transport; the grpc extension is optional and frequently unavailable on shared/PaaS hosts.google/auth and Application Default Credentials — service-account JSON, or workload identity federation in GKE/Cloud Run. This is the main environmental dependency and the most common first-day failure.KmsServiceProvider binding a configured client singleton, a config file with project/region/keyring/key-name, and a small KeyWrapper interface around encrypt/decrypt/asymmetricSign.googleapis/google-cloud-php monorepo, consumed via the google/cloud-kms metapackage or google/cloud. They should not be read as adoption signals. Validate real usage via Packagist download counts on the metapackage and Google's documented support policy, not this repo's social metrics.Technical risk
^1.x versions and treat upgrades as deliberate, tested events rather than automatic Composer updates.transport: 'rest' if infra is unpredictable.encrypt/decrypt is a network round trip and a billable crypto operation. Naive per-field or per-row decryption in list endpoints will produce N+1 KMS calls that are slow and expensive.ENABLED/DISABLED/DESTROYED) all fail at runtime with opaque PermissionDenied / FailedPrecondition errors if misconfigured.Key questions
aws/aws-sdk-php) or Azure Key Vault have larger PHP ecosystems and more community precedent.protectionLevel: HSM) or external key manager, which changes cost and availability tiers?Stack fit
App\Contracts\KeyManagement with wrap, unwrap, sign, verify; implement GoogleKmsKeyManagement and a LocalKeyManagement fake for tests and local dev. This keeps GCP out of domain code and makes the vendor swappable.EncryptedColumn Eloquent cast that stores {keyVersion, wrappedDek, iv, ciphertext, tag} as a single JSON or binary column, so schema changes are contained.Migration path
Encrypter. Ship with no behavior change.crypto_scheme column so reads can dispatch.Compatibility
google/gax and google/protobuf; check for conflicts with other Google packages already in the lockfile (analytics, storage, firebase-admin all share these transitives) — version skew here is the most likely install blocker.APP_KEY encryption must remain functional indefinitely for old rows and for session/cookie encryption, which should not be migrated.Sequencing
Maintenance
ENABLED until the re-wrap completes, then disable. Plan for this before you need it — disabling a version still in use is an outage.Support
Google\ApiCore\ApiException with status codes), not Laravel-shaped. Normalize them into domain exceptions early or every controller will grow its own error handling.Scaling
Failure modes
cloudkms.cryptoKeys.setIamPolicy.NotFound; validate config at deploy, not first request.Ramp-up
How can I help you explore Laravel packages today?