Replies: 5 comments
-
You could manually call |
Beta Was this translation helpful? Give feedback.
-
@rubenvanassche, |
Beta Was this translation helpful? Give feedback.
-
@freekmurze any chance this will be solved one day? |
Beta Was this translation helpful? Give feedback.
-
@rubenvanassche will this be implemented in the upcoming v4? |
Beta Was this translation helpful? Give feedback.
-
Looks like this may be solved with #505 |
Beta Was this translation helpful? Give feedback.
-
Let's say we have a
User
model that hascredentials
attribute being casted toCredentialsData
object and is being stored in the DB as a JSON field.I want to hide properties like "secret" from being exposed once
User
model is being converted to an array for the response (return auth()->user()
in e.g.routes/api.php)
.I tried to use
exceptProperties()
method like so:and it hides needed properties.
However, once I create a
User
:those "secrets" are not being saved to the database.
How can I avoid exposing those "secrets" but still be able to save them into the DB creating users as in my example.
Beta Was this translation helpful? Give feedback.
All reactions