Eloquent encrypted relationship possible? #48049
Unanswered
flashmediasolutions
asked this question in
Q&A
Replies: 1 comment
-
|
Yes, it's possible. Here's a how-to explanation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Looking for any possible insight or help to understand what is possible within Laravel and using FilamentPHP for backend.
Here is an example scenario:
There is a
phoneNumbermodel and astoremodel.A
storebelongsTophoneNumbersand aphoneNumberhasManystoresI understand the traditional creation of foreign id's and relationships.
My issue is that, in this example, the phone numbers are not sensitive, but store details and the relationship between the store and phone number is.
Currently I encrypt the
phoneNumberraw value in thestoretable. Then when I am pulling up the store, I decrypt thephoneNumberand search in thephoneNumbermodel to find the match.So in the
storemodel instead of using:I use:
I want to obfuscate the relationship, between the store and phoneNumber, but maintain access to the eloquent query ability with the phone number and its relationships.
Is there any workaround for this?
Thanks for any insight!
Beta Was this translation helpful? Give feedback.
All reactions