Fix: Resolve ENV parsing issue and implement Cloudflare Turnstile

This commit is contained in:
2025-12-23 08:38:51 +07:00
parent 01d4a925ae
commit 12ae6fe45d
11 changed files with 92 additions and 48 deletions

View File

@@ -0,0 +1,11 @@
@props(['theme' => 'auto', 'size' => 'normal', 'tabindex' => 0])
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<div class="cf-turnstile"
data-sitekey="{{ env('TURNSTILE_SITE_KEY') }}"
data-theme="{{ $theme }}"
data-size="{{ $size }}"
data-tabindex="{{ $tabindex }}"
{{ $attributes }}
></div>

View File

@@ -52,6 +52,8 @@
@enderror
</div>
<!-- Turnstile -->
<x-turnstile class="mb-5" />
<!-- Button -->
<div>
<button type="submit"

View File

@@ -125,6 +125,8 @@
Forgot password?
</a>
</div>
<!-- Turnstile -->
<x-turnstile class="mb-5" />
<!-- Button -->
<div>
<button type="submit"

View File

@@ -146,6 +146,8 @@
</label>
</div>
</div>
<!-- Turnstile -->
<x-turnstile class="mb-5" />
<!-- Button -->
<div>
<button type="submit"

View File

@@ -73,6 +73,8 @@
class="w-full rounded-2xl border-gray-200 bg-gray-50/50 px-5 py-4 text-sm text-gray-900 transition focus:ring-brand-500 focus:border-brand-500 dark:border-gray-700 dark:bg-gray-800 dark:text-white resize-none">{{ old('message') }}</textarea>
</div>
<!-- Turnstile -->
<x-turnstile class="mb-5" />
<div>
<button type="submit"
class="flex w-full justify-center rounded-2xl bg-brand-500 px-4 py-5 text-sm font-bold text-white shadow-xl shadow-brand-500/30 hover:bg-brand-600 focus:outline-none focus:ring-2 focus:ring-brand-500 transition-all active:scale-[0.98]">