@php $captchaService = app(\Flute\Core\Services\CaptchaService::class); $type = $captchaService->getType(); $siteKey = $captchaService->getSiteKey(); $scriptUrl = $captchaService->getScriptUrl(); $enabled = isset($enabled) ? filter_var($enabled, FILTER_VALIDATE_BOOLEAN) : $captchaService->isEnabled($action ?? 'login'); $secretKey = match ($type) { 'recaptcha_v2' => (string) config('auth.captcha.recaptcha.secret_key', ''), 'recaptcha_v3' => (string) config('auth.captcha.recaptcha_v3.secret_key', ''), 'hcaptcha' => (string) config('auth.captcha.hcaptcha.secret_key', ''), 'turnstile' => (string) config('auth.captcha.turnstile.secret_key', ''), 'yandex' => (string) config('auth.captcha.yandex.server_key', ''), default => '', }; $isConfigured = !empty($siteKey) && !empty($secretKey) && !empty($scriptUrl); $captchaAction = (string) ($action ?? 'login'); $instanceId = 'captcha_' . uniqid(); @endphp @if ($enabled && $isConfigured) @if (request()->htmx()->isHtmxRequest()) @else @push('head') @endpush @endif
@if ($type === 'recaptcha_v2')
@elseif($type === 'recaptcha_v3') @elseif($type === 'hcaptcha')
@elseif($type === 'turnstile')
@elseif($type === 'yandex')
@endif
@endif