Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encrypting JSON Field Types #2

Open
LaravelLover069 opened this issue Mar 20, 2021 · 0 comments
Open

Encrypting JSON Field Types #2

LaravelLover069 opened this issue Mar 20, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@LaravelLover069
Copy link

LaravelLover069 commented Mar 20, 2021

Hi Elgibor,

I am using your package to encrypt sensitive PII which works fine for string values and numbers.
When it comes to encrypting JSON fields however the encryption fails upon the following command:

php artisan encryptable:encryptModel 'App\Customer'

PHP Warning: Module 'mbstring' already loaded in Unknown on line 0
342 records will be encrypted

ErrorException
openssl_encrypt() expects parameter 1 to be string, array given

In the customer model I have added the following:

namespace App;

use Illuminate\Database\Eloquent\Model;
use ESolution\DBEncryption\Traits\EncryptedAttribute;

class Customer extends Model
{
    use EncryptedAttribute;

    protected $encryptable = [
        'details'
    ];
}

Please advise how to apply the encryption command on fields containing JSON data.

Many thanks in advance!

@elgibor-solution elgibor-solution added the enhancement New feature or request label Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants