How to use this query in Laravel?
SELECT * FROM table WHERE category = 1 AND item1 < 3 OR item2 < 3 OR item3 < 3
I tried like this
Items::where('category', $category)->where('item1', '<', '3')->where('item2', '<', '3')->where('item3', '<', '3')->count();
And like this
Items::where('category', $category)->where('item1', '<', '3')->orWhere('item2', '<', '3')->orWhere('item3', '<', '3')->count();
But nothing works.. In one category I have two products with 3 items. Each item has some value. I need to check value of each item and count them. I want to show only items where value is less than 3. In this example, it should be 2/2 which means, 2 products with 2 items with value less than 3.