Open IndexZer0 opened 4 months ago
Hey @IndexZer0, thanks for the extensive research and PR! As the impact on the existing filters is minimal, I'm happy to merge this in its current state in the v6 release and see what feedback comes in once people start using the AllowedRelationshipFilter::group()
method.
Is there anything specific you would like feedback on?
Hey @IndexZer0, thanks for the extensive research and PR! As the impact on the existing filters is minimal, I'm happy to merge this in its current state in the v6 release and see what feedback comes in once people start using the
AllowedRelationshipFilter::group()
method.Is there anything specific you would like feedback on?
Thanks for reviewing @AlexVanderbist
Not particulary after specific feedback if you're happy to merge this feature. Just was open to changing the implementation approach if you had any better ideas on how to structure this.
FYI - As it turns out, this package is not going to suit my use case anymore so doubt I'd have the desire to update this PR again.
Hope you can get this merged soon before more merge conflicts :)
This PR adds
AllowedRelationshipFilter
class to be used when wanting to group multipleAllowedFilter
's into the same exists query.Problem:
When using multiple
AllowedFilter
's for nested relations - the package adds mutliple exist clauses to the query.EXISTS
queries.Desired Query
EXISTS
queries.Usage
I have seen various requests for this in the past, for example
https://github.com/spatie/laravel-query-builder/discussions/634
https://github.com/spatie/laravel-query-builder/discussions/663
At this point just looking for your thoughts and feedback on this.
To me, this feels like quite an important missing feature of this package and if the core maintainers could give some feedback, insight and pointers on this then I'm happy to make any changes and then update documentation to match.