protected function assignShippingPlanToProduct(Product $product) : ShippingPlan { $seller = $product->getSeller(); if (!$seller->hasShippingPlans()) { $this->seedShipping($seller); } $product->setShippingPlan($shippingPlan = $seller->getShippingPlans()->random()); return $shippingPlan; }