repository icon indicating copy to clipboard operation
repository copied to clipboard

What's the proper way to create criteria with pivot tables?

Open casenjo opened this issue 9 years ago • 1 comments

I have a table, A, which has a many-to-many relationship with two other tables, B and C, via their respective pivot tables.

My model for A has a method which returns a BelongsToMany relation for table B. How can I use that when I'm building a criteria to find specific results?

Ex: I want to get all of the rows of table A that have a specific value of B in the pivot table

casenjo avatar May 13 '16 16:05 casenjo

+1 Curious as well

tucq88 avatar Jul 07 '16 02:07 tucq88