with('attributes') ->with('attributes/type') ->where('stockIdentifier', StockIdentifierType::NONE, '!=') ->where('attributes/type/name', [ 'primary_supplier', 'lead_time', 'qc_time', 'maximum_stock_quantity', 'minimum_stock_quantity', 'maximum_order_interval', 'minimum_order_quantity', 'order_suggestion_type', 'order_suggestion_optimization_type', 'order_suggestion_history_duration', 'order_suggestion_averaging_method', 'order_suggestion_comparison_duration_type' ], 'IN') ->execute(); foreach ($items as $item) { } } }