You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 7, 2021. It is now read-only.
I found an issue with the commit 573112a, the encrypted fields are being correctly generated but an unencrypted value is being stored in the database.
I've debugged the code and the issue is related to this change introduced 21 days ago (which in fact breaks support for Laravel 5.6 also).
Previously, on insert the $this->attributes property was used directly, now $this->getAtttributes() method is called, which in fact is replaced by the HasEncryptedAttributes trait and this line gets executed which unencrypts all attribute values before insert.
The result is that the package "is broken" because it doesn't achieve it's purpose.
My proposal is to change the getAttributes() method to getUnencryptedAttributes() and use Laravel's Illuminate\Database\Eloquent\Concerns\HasAttributes::getAttributes() implementation directly, but I'm not sure if the getAttributes() is used elsewhere in your code that needs to be changed.
@axelitus Can you make a separate issue for this and include code to reproduce the bug? Without digging in too much, this seems accurate and would explain other oddities when using 5.6/5.7.
Activity
austinheap commentedon Sep 14, 2018
Feedback please: 573112a. 😁
axelitus commentedon Sep 17, 2018
I'm testing this right now. I have already commented an issue in the README file.
austinheap commentedon Sep 17, 2018
@axelitus Good catch! Fixed in commit: 33db743
axelitus commentedon Sep 17, 2018
I found an issue with the commit 573112a, the encrypted fields are being correctly generated but an unencrypted value is being stored in the database.
I've debugged the code and the issue is related to this change introduced 21 days ago (which in fact breaks support for Laravel 5.6 also).
Previously, on insert the
$this->attributes
property was used directly, now$this->getAtttributes()
method is called, which in fact is replaced by the HasEncryptedAttributes trait and this line gets executed which unencrypts all attribute values before insert.The result is that the package "is broken" because it doesn't achieve it's purpose.
My proposal is to change the
getAttributes()
method togetUnencryptedAttributes()
and use Laravel'sIlluminate\Database\Eloquent\Concerns\HasAttributes::getAttributes()
implementation directly, but I'm not sure if thegetAttributes()
is used elsewhere in your code that needs to be changed.austinheap commentedon Sep 17, 2018
@axelitus Can you make a separate issue for this and include code to reproduce the bug? Without digging in too much, this seems accurate and would explain other oddities when using 5.6/5.7.
axelitus commentedon Sep 17, 2018
I'll open an issue later on with a use case
austinheap commentedon Nov 20, 2018
Closing in lieu of #30.