bosnadev / repository

Laravel Repositories is a package for Laravel 5 which is used to abstract the database layer. This makes applications much easier to maintain.
https://bosnadev.com
823 stars 233 forks source link

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

Open casenjo opened 8 years ago

casenjo commented 8 years ago

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

tucq88 commented 8 years ago

+1 Curious as well