Feat: Updating Product imports after Boboko restructure

This commit is contained in:
2026-08-27 11:46:33 +03:00
parent 86c645fb36
commit defe1dab12
6 changed files with 14 additions and 31 deletions
+2 -3
View File
@@ -4,7 +4,7 @@
use Illuminate\Http\Response;
use Lunar\Models\Collection;
use Modules\Core\Product\Services\ProductService;
use Modules\Core\Catalog\Services\ProductService;
class ProductController extends Controller
{
@@ -13,11 +13,10 @@ public function __construct(private readonly ProductService $products) {}
public function show(string $locale, int $id)
{
$product = $this->products->getById($id);
abort_if($product === null, Response::HTTP_NOT_FOUND);
$collection = $product['collections'][0] ?? null;
$collectionModel = $collection !== null ? Collection::find($collection) : null;
$collectionModel = $collection !== null ? Collection::find($collection['id']) : null;
$variantsData = collect($product['variants'])
->map(fn (array $variant) => [