laravel-database-encryption
laravel-database-encryption copied to clipboard
Encrypting JSON Field Types
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!