I’m trying to use a google captcha validation in a form and I notice the value of the response won’t send with the request
Here is my Captcha Rule:
public function passes($attribute, $value)
{
$captcha = new ReCaptcha(env('CAPTCHA_SECRET_KEY'));
$response = $captcha->verify($value, $_SERVER['REMOTE_ADDR']);
return $response->isSuccess();
}
The view
<div class="flex items-center justify-center mt-10">
<div>
<div class="g-recaptcha" data-sitekey="{{ env('CAPTCHA_SITE_KEY') }}"></div>
@if ($errors->has('g-recaptcha-response'))
<span class="block text-orange-700 mt-5">
<strong>{{ $errors->first('g-recaptcha-response') }}</strong>
</span>
@endif
</div>
</div>
The $request->all()
output
array:6 [▼
"id" => "X501DDfFUiLy8CTmEYhc"
"data" => array:1 [▼
"demo" => null
]
"name" => "landing.demo"
"checksum" => "4b5c299935b0bfd844d49277dda19706da1812008cb763b973406163eef7e08a"
"children" => []
"actionQueue" => array:1 [▼
0 => array:2 [▼
"type" => "callMethod"
"payload" => array:2 [▼
"method" => "submitDemo"
"params" => []
]
]
]
]
Any Ideas?