Mahmoud Santos

23 Feb 2022

How can I validate recaptcha in Livewire class ??


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
 '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 -->
 <div class="form-group">
 <div wire:model.defer="g-recaptcha-response" class="g-recaptcha"
 <span class="invalid-feedback mt-3" role="alert">
 <strong>{{ $message }}</strong>



Yasen Sayed

23 Feb 2022

Best Answer

best answer

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.




Mahmoud Santos

23 Feb 2022

Thank you, that was really helpful 

© 2024 Copyrights reserved for