I have tried many solution but no one can help. I'm using google recaptcha for my laravel project and i'm using this library "buzz/laravel-google-captcha": "^2.2"
Here is it my code in view
<div class="col-md-6">
@php($attributes = [])
{!! Form::captcha($attributes) !!}
@if ($errors->has('g-recaptcha-response'))
<span class="invalid-feedback" style="display: block;">
<strong>{{ $errors->first('g-recaptcha-response') }}</strong>
</span>
@endif
</div>
My code in LoginController
public function validateLogin(Request $request){
$this->validate($request, [
$this->username() => 'required',
'password' => 'required',
'g-recaptcha-response' => 'required|captcha',
]);
}
I got an error
file_get_contents(https://www.google.com/recaptcha/api/siteverify): failed to open stream: Connection timed out
I have tried restart my VPS, i have update my secret-key, i have turn on in configuration allow_url_fopen=On and allow_url_include=On
I still got the error. Anyone can help me? It works fine in localhost
I'm using centos 7, laravel 5.7