From 483c0ce00f3cbbd636af186444cdc9bd4db57e49 Mon Sep 17 00:00:00 2001 From: Konstantinos Arvanitakis Date: Tue, 1 Sep 2026 13:03:39 +0300 Subject: [PATCH] Fix: Recommendations are an eloquent collection, not an Generic Collection --- src/Catalog/Services/RecommendationService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Catalog/Services/RecommendationService.php b/src/Catalog/Services/RecommendationService.php index 3e107f4..986884c 100644 --- a/src/Catalog/Services/RecommendationService.php +++ b/src/Catalog/Services/RecommendationService.php @@ -2,7 +2,7 @@ namespace Modules\Core\Catalog\Services; -use Illuminate\Support\Collection; +use Illuminate\Database\Eloquent\Collection; use Lunar\Models\Product; use Modules\Core\Catalog\Contracts\RecommendationRule; @@ -25,7 +25,7 @@ class RecommendationService */ public function recommend(Product $product, int $limit = 4): Collection { - $recommendations = collect(); + $recommendations = new Collection(); foreach (config('catalog.recommendation_rules', []) as $ruleClass) { if ($recommendations->count() >= $limit) {