<?php

namespace App\Domains\Link\Actions;

use App\Domains\Link\Models\Link;
use App\Domains\Link\Services\LinkCacheService;

class DeleteLink
{
    public function __construct(private LinkCacheService $cache) {}

    public function handle(Link $link): void
    {
        $link->delete();
        $this->cache->forget($link->slug, $link->domain_id);
    }
}
