service-captcha/app/Repositories/CaptchaRepository.php

20 lines
450 B
PHP
Raw Normal View History

<?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();
}
}