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

Feature: add ability to store eloquent casts as an encrypted string #723

Merged
merged 7 commits into from
Jun 13, 2024
Merged

Feature: add ability to store eloquent casts as an encrypted string #723

merged 7 commits into from
Jun 13, 2024

Conversation

eugen-stranz
Copy link
Contributor

@eugen-stranz eugen-stranz commented Mar 28, 2024

Similar to Laravel's ability to store encrypted strings by providing a cast this enhancement allows the storage of data objects / collections as an encrypted string.

It works by appending the ":encrypted" key to the cast within the eloquent model on the specific column

for example:
Screenshot 2024-03-28 at 10 55 53

Screenshot 2024-03-28 at 10 52 07

Both columns "data" and "secrets" store the same data object.
Screenshot 2024-03-28 at 10 53 00

@rubenvanassche
Copy link
Member

Could you add some tests to this feature so that it wouldn't be removed by accident?

@rubenvanassche
Copy link
Member

And some docs so everyone can use this feature!

@eugen-stranz
Copy link
Contributor Author

Hello @rubenvanassche

I will provide the missing parts this week.

Thank you for your feedback.

@eugen-stranz
Copy link
Contributor Author

Hello @rubenvanassche

the requested tests and documentation have been implemented.

@rubenvanassche
Copy link
Member

Thanks!

@rubenvanassche rubenvanassche merged commit 8c7c548 into spatie:main Jun 13, 2024
11 checks passed
@eugen-stranz eugen-stranz deleted the feat/ability_to_encrypt_eloquent_cast branch June 21, 2024 10:14
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

Successfully merging this pull request may close these issues.

2 participants