SELECT * FROM products AS P
LEFT JOIN product_categories AS PC ON PC.product_id = P.id
WHERE
PC.category_id = 3
AND
(
SELECT COUNT(*) FROM product_options AS PO
WHERE
(
PO.classifier_id = 1 AND PO.option_id IN (5)
)
OR
(
PO.classifier_id = 3 AND PO.option_id IN (29)
)
OR
(
PO.classifier_id = 4 AND PO.option_id IN (55, 57, 59)
)
) >= 3
Argument #1 ($request) must be of type App\\Http\\Requests\\TestRequest, Illuminate\\Http\\Request given