service-captcha/app/Repositories/CaptchaRepository.php
Leonid Nikitin 9221e089dd
Revived API POST /captcha/{captcha_uuid}.
Receiving captcha information for validation.
2023-11-26 22:42:22 +06:00

20 lines
450 B
PHP

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