<?php

namespace App\Observers;

use App\Models\ProductManagement\Product;

class ProductObserver{

    public function creating(Product $product){
        $attributes = $product->getAttributes();

        if (!isset($attributes['ref'])){
           // $product->setAttribute("ref",Status::NEW_ORDER);
        }
    }


    public function deleted(Product $product){
        $product->media?->map?->delete();
    }
}
