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
Fields will automatically be filtered if the filter_fields_parameter configuration key is set to a string. It defaults to only, allowing you to filter fields from the query string:
GET /products?only=id,name
Would be nice if you could have the opposite for only, for example:
...?hide=id,name
...?except=id,name
And then those fields would be empty when returning the transformer
The text was updated successfully, but these errors were encountered:
Agreed that would be nice, however, if I remember correctly Fractal didn't have this feature and the filtering is currently based on their implementation. With that said I started out adding both only and except to the new version, but then removed them as I didn't want the package to be concerned about the query string anymore. Instead I was looking into moving all this logic into a new Laravel Requester or Laravel Inquirer package which handled the parsing of query strings and allowed for filtering fields, querying results, sorting, including relations etc.
Was thinking of creating an issue to discuss this idea further, but would love to hear your initial opinions on it.
I always like when things can be splitted to smaller components and if all this logic can be moved to Requester or Inquirer packages, that sounds good if those packages are flexible to work with :)
Filtering From Query String
Fields will automatically be filtered if the filter_fields_parameter configuration key is set to a string. It defaults to only, allowing you to filter fields from the query string:
Would be nice if you could have the opposite for only, for example:
...?hide=id,name
...?except=id,name
And then those fields would be empty when returning the transformer
The text was updated successfully, but these errors were encountered: