<?php declare(strict_types=1);

namespace App\Repositories;

use App\Models\Captcha;
use App\Models\CaptchaToken;

final class CaptchaRepository
{
    public function getCaptchaById(int $id): ?Captcha
    {
        return Captcha::query()->where('id', $id)->first();
    }

    public function getCaptchaByUuid(CaptchaToken $captchaToken, string $uuid): ?Captcha
    {
        return $captchaToken->captchas()->where('uuid', $uuid)->first();
    }
}