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

Adding Hidden Attribute #505

Merged
merged 3 commits into from
Aug 9, 2023
Merged

Adding Hidden Attribute #505

merged 3 commits into from
Aug 9, 2023

Conversation

dbpolito
Copy link
Contributor

@dbpolito dbpolito commented Jul 18, 2023

From #472

There are some properties we want to be on for DTO, for internal usage, but don't want to be exposed when sent to the frontend...

This PR adds a Hidden attribute for excluding it from the output.

@rubenvanassche
Copy link
Member

Could you please revert to the original version of your PR?

In contraire to what the user in #472 was saying, we don't have a feature that will hide properties from payloads but will include them when saving to the database.

Now we're in an inconsistent state where some properties using Hide will be saved to the database and others except and only wont. If we want to include properties when saving to the database a manual transform should be executed and a feature should be implemented there which enables or disables excepts(basically the Hide of this PR) and only's. But such a feature is more something for v4 which totally rethinks how transformation contexts work.

@dbpolito
Copy link
Contributor Author

dbpolito commented Aug 4, 2023

@rubenvanassche Done 👍

@rubenvanassche
Copy link
Member

Thanks!

@rubenvanassche rubenvanassche merged commit 31e9fae into spatie:main Aug 9, 2023
11 checks passed
@linaspasv
Copy link

Could you please revert to the original version of your PR?

In contraire to what the user in #472 was saying, we don't have a feature that will hide properties from payloads but will include them when saving to the database.

Now we're in an inconsistent state where some properties using Hide will be saved to the database and others except and only wont. If we want to include properties when saving to the database a manual transform should be executed and a feature should be implemented there which enables or disables excepts(basically the Hide of this PR) and only's. But such a feature is more something for v4 which totally rethinks how transformation contexts work.

Do we have anything in v4 that would allow us to save to Database but keep sensitive data from output?

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.

3 participants