laravel-crm icon indicating copy to clipboard operation
laravel-crm copied to clipboard

Organization name is being encrypted on creation.

Open DCox2016 opened this issue 1 year ago • 3 comments

image

The organization name is being encrypted and causing a name too long error

DCox2016 avatar Jun 17 '23 16:06 DCox2016

I commented out the protected $encryptable name and I now get this image Which is the phone number and I can see why this is encrypted because it is personal data, so I think we just need to add migrations to have the database columns accept encrypted strings. Let me know if I have the right approach

DCox2016 avatar Jun 17 '23 16:06 DCox2016

This is a problem when migrations are run before the encrypt db fields config is set as true.

There is a migration that checks if field encrption is true, and then alters the data types on these fields to allow for the longer strings.

eg organisation name will be varchar(1000) rather than varchar(255)

I will need to think about how to manage this, prompting a database update required if the setting is changed post running migrations will be a solution

andrewdrake avatar Jun 18 '23 09:06 andrewdrake

So I created 4 migrations Each updates the column type from string to text. crm_organisations - name crm_phones - number crm_emails - address crm_address - line1, line2, line3, city, state, code, country

This allowed me to create a organization.

DCox2016 avatar Jun 18 '23 15:06 DCox2016