Mahmoud Santos
Published in : 2022-02-23
Hello guys, Please anyone can help me to do Recaptcha in the Livewire class?
I recently moved my contact form to a livewire component and everything works except my google Recaptcha it no longer works.
// Validate contact info $this->validate([ 'name' => 'required|min:4|max:30', 'email' => 'required|email', 'subject' => 'required|min:5|max:100', 'message' => 'required|min:30|max:500', 'g-recaptcha-response' => config('services.recaptcha.key') ? 'required|recaptcha' : 'nullable', ]);
component form
<!-- google recaptcha --> @if(config('services.recaptcha.key')) <div > <div wire:model.defer="g-recaptcha-response" data-sitekey="{{config('services.recaptcha.key')}}"> </div> @error('g-recaptcha-response') <span role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> @endif
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now
Yasen Sayed Date : 2022-02-23
Best answers
8
Best answers
8
If you know Arabic I made a small video to describe how you can use it.
You should follow the next steps in the video, I hope these are will help you.
//www.youtube.com/watch?v=TFJCHny_VgU&ab_channel=LARATRICKS
Mahmoud Santos Date : 2022-02-23
Thank you, that was really helpful