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

Support for Eloquent hidden attributes in discoverProperties #213

Closed
andrew-alchemy opened this issue Mar 11, 2022 · 2 comments
Closed

Support for Eloquent hidden attributes in discoverProperties #213

andrew-alchemy opened this issue Mar 11, 2022 · 2 comments

Comments

@andrew-alchemy
Copy link

andrew-alchemy commented Mar 11, 2022

When discovering Eloquent models it would be really useful to allow for some of the underlying table columns to be suppressed by respecting the "hidden" property of the Model. I very rarely want to expose every column of my tables.
In the SQLSchema trait I think we just need something along the lines of this (after checking we are in an EloquentEntitySet and $this->model is set)
$blacklist = array_merge( $blacklist, $this->getModel()->getHidden());

@27pchrisl
Copy link
Contributor

That's an excellent shout @andrew-alchemy, really Lodata should follow more of the rules in https://laravel.com/docs/9.x/eloquent-serialization#hiding-attributes-from-json. I will look into this.

@27pchrisl
Copy link
Contributor

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

No branches or pull requests

2 participants