fix: ensure brands array serializes correctly when empty

Added ->values() to prevent empty Collection from serializing as {} instead of []
This fixes Alpine.js error when all brands have null hashids
This commit is contained in:
kelly
2025-12-06 16:25:02 -07:00
parent 26a903bdd9
commit 58ca83c8c2

View File

@@ -45,7 +45,7 @@
'lastOrderDate' => now()->subDays(rand(1, 90))->diffForHumans(),
'activeListings' => rand(0, ($brand->products_count ?? 0)),
];
})),
})->values()),
get filteredBrands() {
let filtered = this.brands.filter(brand => {