/home/techb158/immovalet.com/platform/plugins/ecommerce/src/Models
Edit: /home/techb158/immovalet.com/platform/plugins/ecommerce/src/Models/ProductCollection.php (1445B)
BaseStatusEnum::class,
];
protected static function boot()
{
parent::boot();
self::deleting(function (ProductCollection $collection) {
$collection->discounts()->detach();
});
}
/**
* @return BelongsToMany
*/
public function discounts()
{
return $this->belongsToMany(Discount::class, 'ec_discount_customers', 'customer_id', 'id');
}
/**
* @return BelongsToMany
*/
public function products()
{
return $this
->belongsToMany(
Product::class,
'ec_product_collection_products',
'product_collection_id',
'product_id'
)
->where('is_variation', 0);
}
}