Laravel encrypted fields
lcallif opened this issue · 1 comments
lcallif commented
I have a group of fields that are encrypted in the table I would like to seed. Is this possible to do ?
I do have a work around, but would prefer to use db-seeder. The work around is to create a copy of the table I would like to have seeded, run db-seeder on the table, and run a php function to retrieve the data from the copied table, encrypt the required fields as they are being inserted into the real table....
One other item. The encryption, if performed by db-seeder, would need to use the APP_KEY in the .env file OR allow for this value to be entered into db-seeder for the encryption.
haruncpi commented
You can use constant
data type and put encrypted data (generate by your application) as a value.