From d84e28d8bc20f2daf92bd83898b3229c8ac2eed3 Mon Sep 17 00:00:00 2001 From: K Muller Date: Thu, 28 May 2026 17:00:54 +0200 Subject: [PATCH] fix: recaptcha contact --- config/services.php | 5 ++ .../contact/contact-form-script.blade.php | 30 ++++++++++++ .../contact/partials/form-footer.blade.php | 46 +++++++++++-------- .../contact/partials/form-index.blade.php | 3 ++ 4 files changed, 65 insertions(+), 19 deletions(-) create mode 100644 resources/views/components/front/pages/contact/contact-form-script.blade.php diff --git a/config/services.php b/config/services.php index 5f52757a..01329e5f 100644 --- a/config/services.php +++ b/config/services.php @@ -37,6 +37,11 @@ return [ 'google' => [ 'maps' => env('GOOGLE_MAPS_KEY'), + 'recaptcha' => [ + 'public' => env('GOOGLE_RECAPTCHA_PUBLIC'), + 'private' => env('GOOGLE_RECAPTCHA_PRIVATE'), + 'version' => env('GOOGLE_RECAPTCHA_VERSION', "3") === "3" ? true : false + ] ], 'matomo' => [ diff --git a/resources/views/components/front/pages/contact/contact-form-script.blade.php b/resources/views/components/front/pages/contact/contact-form-script.blade.php new file mode 100644 index 00000000..e5f57ef5 --- /dev/null +++ b/resources/views/components/front/pages/contact/contact-form-script.blade.php @@ -0,0 +1,30 @@ +@push('scripts') + +@endpush diff --git a/resources/views/front/pages/contact/partials/form-footer.blade.php b/resources/views/front/pages/contact/partials/form-footer.blade.php index ea9703cd..019ef392 100644 --- a/resources/views/front/pages/contact/partials/form-footer.blade.php +++ b/resources/views/front/pages/contact/partials/form-footer.blade.php @@ -1,29 +1,37 @@ - -
- @if (\App\Enums\Contact\ContactFormType::press->equals($contactFormType)) -
- -
- @endif - - +
+ @if (\App\Enums\Contact\ContactFormType::press->equals($contactFormType))
- {{ __('front.contact.info_personal_data') }} -
{{ __('front.contact.confidentiality') }}
+
+ @endif -
-
* {{ ucfirst(__('front.required_field')) }}
-
+ +
+ {{ __('front.contact.info_personal_data') }} +
{{ __('front.contact.confidentiality') }}
+
+
* {{ ucfirst(__('front.required_field')) }}
+
+
+ +{{-- RECAPTCHA --}} +
+
+ @if ($errors->has('g-recaptcha-response')) +
+ {{ $errors->first('g-recaptcha-response') }} +
+ @endif +
- +
diff --git a/resources/views/front/pages/contact/partials/form-index.blade.php b/resources/views/front/pages/contact/partials/form-index.blade.php index 0e1e0414..54fbec2d 100644 --- a/resources/views/front/pages/contact/partials/form-index.blade.php +++ b/resources/views/front/pages/contact/partials/form-index.blade.php @@ -28,7 +28,10 @@ @endif @include('front.pages.contact.partials.form-footer') +
+ +