Skip to content
This repository was archived by the owner on Apr 7, 2021. It is now read-only.
This repository was archived by the owner on Apr 7, 2021. It is now read-only.

Add support for Laravel 5.7 #28

Closed
Closed
@axelitus

Description

@axelitus

Currently this package cannot be installed with Laravel 5.7 due to the restriction:

"require": {
    "laravel/framework": "5.5.*|5.6.*",
}

Please add support for Laravel 5.7

Activity

austinheap

austinheap commented on Sep 14, 2018

@austinheap
Owner

Feedback please: 573112a. 😁

axelitus

axelitus commented on Sep 17, 2018

@axelitus
Author

I'm testing this right now. I have already commented an issue in the README file.

austinheap

austinheap commented on Sep 17, 2018

@austinheap
Owner

@axelitus Good catch! Fixed in commit: 33db743

axelitus

axelitus commented on Sep 17, 2018

@axelitus
Author

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.

austinheap

austinheap commented on Sep 17, 2018

@austinheap
Owner

@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

axelitus commented on Sep 17, 2018

@axelitus
Author

I'll open an issue later on with a use case

austinheap

austinheap commented on Nov 20, 2018

@austinheap
Owner

Closing in lieu of #30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @austinheap@axelitus

      Issue actions

        Add support for Laravel 5.7 · Issue #28 · austinheap/laravel-database-encryption