<?php

namespace App\Observers\Restaurant;

use App\Models\Restaurant\ProductCategory;

class ProductCategoryObserver
{
    public function deleting(ProductCategory $category): void
    {
        // Avoid Delete Category "Amenities"
        if (in_array($category->category_code, ['SCP-01']))
            throw new \Exception("Amenities category cannot be Deleted.");
    }
}
