Multi value delimiter cannot be set individually for single filters #958
Unanswered
cristiancalara
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, you cannot set a multi-value delimiter individually as:
The second call will overwrite the static value of the delimiter set in the first filter. Added this as a bug as the documentation and the PR feel like suggest you could do that.
I looked a bit at what it will take to actually allow this feature (which is useful, at least for filters). If we consider that the class
QueryBuilderRequest
was "internal", we could update and:-> have the Filter class hold a new attribute called
filterDelimiter
that would default to the current static value;-> send the allowedFilters list to
$this->request->filters()
calllaravel-query-builder/src/Concerns/FiltersQuery.php
Line 36 in ed71451
-> update the
laravel-query-builder/src/QueryBuilderRequest.php
Line 109 in ed71451
allowedFilters
andfilterDelimiter
ingetFilterValue
Obviously the above is quite hacky and not that elegant. Another option might be to transform
$filterArrayValueDelimiter
into an dictionary and then we'd have unique keys (maybe request from user or somehow automatically create one) across the app and do something like:Let me know any thoughts on the above and if you think any of the suggested implementations are worth a PR.
Thanks for a great package!
Beta Was this translation helpful? Give feedback.
All reactions