Level 75
Use package for that.
This is for invisible recaptcha
https://github.com/albertcht/invisible-recaptcha
Or find something similar.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am working on a Google reCaptcha Registration page using Laravel 8. I am not using any package.
I added below code in header.
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
My blade file code is like below
<form method="POST" action="{{ url('/register') }}" enctype="multipart/form-data">
@csrf
<div class="form-group mt-5">
<div class="g-recaptcha" data-sitekey="sitekeytext"></div>
</div>
@error('g-recaptcha-response')
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
@enderror
<button type="submit" class="btn mt-3 mb-5">Submit</button>
</form>
I checked reCaptcha check box in Registration page and submitted the form
I am debugging using below code in Controller.
public function store(Request $request)
{
dd($request); // `g-recaptcha-response` is absent here
}
Why g-recaptcha-response is absent here ?
Please or to participate in this conversation.