timgws / QueryBuilderParser

A simple to use query builder for the jQuery QueryBuilder plugin for use with Laravel.
MIT License
159 stars 65 forks source link

Filtering many-to-many joins #28

Closed ziadoz closed 6 years ago

ziadoz commented 6 years ago

Hi. I wondered if it's possible to filter many-to-many joins using the JoinSupportingQueryBuilderParser?

I have a table setup similar to this (the real thing is more complex, but this is the gist):

products
--------
id
name

attributes
----------
id
name
value

products_attributes
-------------------
product_id
attribute_id

I guess I'm wondering if it's possible to build a query that can filter this setup correctly, selecting all the products by joining on products_attributes.attribute_id but filtering on attributes.value.

Any advice on whether or not this can be done using the existing code would be great. Thanks.

Naghal commented 1 year ago

Have you found a solution?