Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isEncryptedCastable #230

Open
kiwina opened this issue Jul 12, 2021 · 4 comments
Open

Add isEncryptedCastable #230

kiwina opened this issue Jul 12, 2021 · 4 comments

Comments

@kiwina
Copy link

kiwina commented Jul 12, 2021

Need to add a check to getModelAttributes if the value is isEncryptedCastable

@dwightwatson
Copy link
Owner

Happy to review a PR with tests that covers this functionality. Unfortunately I'm not in a position to work on this feature at the moment.

@kiwina
Copy link
Author

kiwina commented Jul 13, 2021

Will look into it i'm testing it at the moment to see if the implementation works properly or not, then i'll add some tests to it and make a PR
currenty i have:
if (method_exists($this, 'isEncryptedCastable') && $this->isEncryptedCastable($key)) { $attributes[$key] = $value; continue; }
witch should work with older laravel versions

@kiwina
Copy link
Author

kiwina commented Jul 20, 2021

so after a little further testing the code isn't really necessary for it to work but if there is custom setters the encrypted attribute its necessary for it to work

@kiwina
Copy link
Author

kiwina commented Jul 26, 2021

I think i got it figured out now with the encryption so far none of my tests fail still a little testing to be done before i can make a pull request
if (method_exists($this, 'isEncryptedCastable') && $this->isEncryptedCastable($key) && $this->getModel()->hasSetMutator($key)) { $attributes[$key] = $value; continue; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants