You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having a lot of difficulty with this library and how it's intended to be used.
I have an Inventory table and an inventoryRequest relation. All my tables have id columns that are internal-only, as well as public-facing unique display_id columns.
Ideally I want to specify only certain fields on both the Inventory and the inventoryRequest relationship to be allowed. It is incredibly confusing to me that QueryBuilder's ->allowedFields() method defaults to including all Model properties, even when they're not "allowed", but I at least can deal with it, sort of, with the ->query()->select() workaround.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm having a lot of difficulty with this library and how it's intended to be used.
I have an
Inventory
table and aninventoryRequest
relation. All my tables haveid
columns that are internal-only, as well as public-facing uniquedisplay_id
columns.Ideally I want to specify only certain fields on both the
Inventory
and theinventoryRequest
relationship to be allowed. It is incredibly confusing to me that QueryBuilder's->allowedFields()
method defaults to including all Model properties, even when they're not "allowed", but I at least can deal with it, sort of, with the->query()->select()
workaround.As it stands, if I make a request like this:
I get a request that completely ignores my fields constraint. (Same if I format the query param like
fields=inventoryRequest.display_id
)The response looks like this:
At this point I am wondering if it's just a bug with the library. I can do a query like:
And it will filter the top-level objects to only have
display_id
, but the inventoryRequest relationship will be the full model data again.Beta Was this translation helpful? Give feedback.
All reactions