My model has a relationship with an attribute model. Each attribute has its own values. I execute a query like this, but it is very slow.
foreach($request->