Kyslik / laravel-filterable

Laravel 5/6/7 package to handle filtering by query-string
MIT License
116 stars 34 forks source link

Filter based on many to many? #8

Closed dambridge closed 6 years ago

dambridge commented 6 years ago

Apologies if this isn't a proper issue. I have roles associated with my users through a hasMany relationship -- is it possible to filter based on an associated role? Do I need to construct a join query myself in my user filter?

Kyslik commented 6 years ago

No need to apologize :)


You may use custom filters, which allows you to manipulate builder instance however you want, its available under $this->builder, which you are supposed to return. Other than that you can not do anything related to M-M relationship out of the box.

Good luck!