Replies: 2 comments
-
I have same issue. I fixed it (temporarly) with something like: // $query = SomeModel::query()->...
$model = $query->getModel();
if ($model instanceof CipherSweetEncrypted
&& method_exists($model, 'bootUsesCipherSweet')
) {
$fieldsEncrypted = $model::$cipherSweetEncryptedRow->listEncryptedFields();
$query->select($fieldsEncrypted);
}
// ... |
Beta Was this translation helpful? Give feedback.
0 replies
-
in the config file, (mine is at api/config/ciphersweet.php) change the key
source: #43 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I have a User Model with follwing fields:
['first_name', 'last_name', 'email', 'password', 'phone_number', 'current_organization_id', 'is_active']
And there first_name, last_name, email, phone_number are encrypted like so:
`public static function configureCipherSweet(EncryptedRow $encryptedRow): void
{
$encryptedRow
->addField('email')
->addBlindIndex('email', new BlindIndex('email_index'));
All works good so far but when I try to query the data and do not select all encrypted fields like so:
User::query() ->isOrganizationMember($organization) ->isClient() ->select('id', 'first_name', 'last_name', 'email') ->get();
Then I get the following error:
ParagonIE \ CipherSweet\ Exception\ EmptyFieldException PHP 8.0.30 9.52.12 Field is not defined in row: phone_number
Is there a way to still only select the needed columns in the query?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions