feat: refactor product attributes handling to use product_attribute table and update related models and requests
This commit is contained in:
@@ -21,7 +21,7 @@ class ProductVariantController extends Controller
|
||||
|
||||
$query = ProductVariant::query()
|
||||
->where('producto_id', $producto->id)
|
||||
->with(['product', 'definitions.attribute.options', 'attachments'])
|
||||
->with(['product', 'definitions.productAttribute.attribute.options', 'attachments'])
|
||||
->latest();
|
||||
|
||||
return ProductVariantResource::collection($query->paginateFromRequest())->response();
|
||||
@@ -41,7 +41,7 @@ class ProductVariantController extends Controller
|
||||
$producto = $this->resolveScopedProduct($tenant, $producto);
|
||||
$productVariant = $this->resolveScopedVariant($producto, $productVariant);
|
||||
|
||||
return ProductVariantResource::make($productVariant->load(['product', 'definitions.attribute.options', 'attachments']));
|
||||
return ProductVariantResource::make($productVariant->load(['product', 'definitions.productAttribute.attribute.options', 'attachments']));
|
||||
}
|
||||
|
||||
public function update(UpdateProductVariantRequest $request, Tenant $tenant, Product $producto, ProductVariant $productVariant, ProductService $productService): ProductVariantResource
|
||||
|
||||
Reference in New Issue
Block a user