Is there a way to add a where
clause on one of the tables of the pivot table
inside the pivot table
? For example in the code below, how can i add a where
clause in products_categories
to specify the products
with type='ELECTRONICS'
?
DB::table("products_categories")
->whereIn("category_id", array_values($ids))
->pluck("id")
->all();