skip to Main Content

handle n+1 with hasManyThrough relation – Laravel

my product has relation called values which is like this: public function values() { return $this->hasManyThrough(VariantValue::class, VariantProductOption::class, 'product_id', 'product_option_id'); } everything works fine but when i have a multiple products in a single pages n+1 problem happens: select `variant_sku_values`.*, `variant_sku_product_options`.`product_id`…

VIEW QUESTION
Back To Top
Search