Open
Description
This might be useful when migrating data that was initially unencrypted.
My current thinking is something like:
Post::query()->each(function ($post) {
$post->withoutRichTextDecryptionOnRead(function () use ($post {
$post->update(['content' => $post->content?->toTrixHtml()]);
});
});
But it could also look like this:
protected $richTextAttributes = [
'content' => ['encrypted' => true, 'allow_unencrypted_data' => true],
];
The idea is that we allow the decryption to fail when reading the data when that context is set. This way, we allow encrypting existing data that's currently not encrypted at rest.
Metadata
Metadata
Assignees
Labels
No labels