order_items)) { return; } $productIds = $order->order_items->pluck('post_id'); $productFeeds = $this->getProductsFeeds($productIds); $formattedFeeds = (new GlobalIntegrationSettings())->formatFeedsData($productFeeds); (new GlobalNotificationHandler())->triggerNotification( $formattedFeeds, $order, $customer, $targetHook, $group, 'product_integration' ); } public function getProductsFeeds($productIds) { return ProductMeta::query()->where('object_type', 'product_integration') ->whereIn('object_id', $productIds) ->get(); } }