<?php
namespace Modules\NsGastro\Listeners;

use App\Events\ProductBeforeDeleteEvent;
use Modules\NsGastro\Services\GastroOrderService;

class ProductBeforeDeleteEventListener
{
    public function __construct( public GastroOrderService $gastroOrderService )
    {
        // ...
    }
    public function handle( ProductBeforeDeleteEvent $event)
    {
        $this->gastroOrderService->deleteModifiers( $event->product );
    }
}