Add properties filtering and relationships in Product model

This commit is contained in:
2026-02-05 01:08:07 +05:00
parent 45bc0b61a1
commit 38fa0e2e45
11 changed files with 227 additions and 2 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Observers;
use App\Models\Ecommerce\Product\Property\ProductAttributeValue;
class ProductAttributeValueObserver
{
/**
* Handle the ProductAttributeValue "created" event.
*/
public function created(ProductAttributeValue $productAttributeValue): void
{
$productAttributeValue->productProperty->product->syncPropertiesJson();
}
/**
* Handle the ProductAttributeValue "updated" event.
*/
public function updated(ProductAttributeValue $productAttributeValue): void
{
$productAttributeValue->productProperty->product->syncPropertiesJson();
}
/**
* Handle the ProductAttributeValue "deleted" event.
*/
public function deleted(ProductAttributeValue $productAttributeValue): void
{
$productAttributeValue->productProperty->product->syncPropertiesJson();
}
}