2023-11-26 15:09:42 +06:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Repositories;
|
|
|
|
|
|
|
|
use App\Models\Captcha;
|
2023-11-26 22:42:22 +06:00
|
|
|
use App\Models\CaptchaToken;
|
2023-11-26 15:09:42 +06:00
|
|
|
|
|
|
|
final class CaptchaRepository
|
|
|
|
{
|
|
|
|
public function getCaptchaById(int $id): ?Captcha
|
|
|
|
{
|
|
|
|
return Captcha::query()->where('id', $id)->first();
|
|
|
|
}
|
2023-11-26 22:42:22 +06:00
|
|
|
|
|
|
|
public function getCaptchaByUuid(CaptchaToken $captchaToken, string $uuid): ?Captcha
|
|
|
|
{
|
|
|
|
return $captchaToken->captchas()->where('uuid', $uuid)->first();
|
|
|
|
}
|
2023-11-26 15:09:42 +06:00
|
|
|
}
|