<?php

namespace ZenoChatbot\Services\Chat;

use ZenoChatbot\Model\SavedReply;
use ZenoChatbot\Services\Chat\Contracts\HitCounterInterface;

class DatabaseHitCounter implements HitCounterInterface
{
    /**
     * Increment hit count in the database
     *
     * @param int $replyId The saved reply ID
     */
    public function increment($replyId): void
    {
        if ($reply = SavedReply::find($replyId)) {
            $reply->incrementHitCount();
        }
    }
}

