This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

JimRed
JimRed

Hello Guys,

Please help me.
I have a database table and I have a sensitive field so I would like to store the data in encrypted format.
I wrote the following line into my model php:
protected $encrypted = ['secret_code'];

...but when I save data via backend into the table the field store the plain (not-encrypted) data in the table.

Could you please help me how should I use the function properly?

Thank you

that0n3guy
that0n3guy

Is your 'secret_code' the name of your column?

JimRed
JimRed

Yes it is...

alisaracoglu
alisaracoglu

Perhaps someone like me will come here many years later. Don't forget to add

    use \October\Rain\Database\Traits\Encryptable;

to the beginning of the file. :)

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.