Closed andresrex closed 7 years ago
i have same problem for some users
Any Results???
I'm honestly not sure what to tell you guys. I just did a fresh clone of Laravel 5.3, wired it up with the minimum stuff required, and tested this package - and it works fine.
// the form
<form method="post">
{{ csrf_field() }}
{!! Recaptcha::render() !!}
<input type="submit">
</form>
// the route
Route::post('/', function(\Illuminate\Http\Request $request) {
$validator = Validator::make($request->all(), [
'g-recaptcha-response' => 'required|recaptcha',
]);
if ($validator->fails()) {
echo "You failed.";
} else {
echo "YOU PASSED!";
}
});
If it works for everyone else on your team but not you, then I'd say check your local configuration. Make sure you don't have spaces anywhere in the keys, etc.
I have same problem. Works perfectly in production. On my local machine using Laravel Valet, it fails 95% of the time so it's quite annoying having to keep submitting a form to test it out.
I was also having this issue in my local development environment using Valet. I tracked it down to the curl_timeout After incressing my timeout value I no longer have this issue.
File: config/recaptcha.php
'options' => [
'curl_timeout' => 5,
],
@incon Do you find that all network requests and (external) database queries are very very slow under Valet?
@pjebs yes Valet can be slow and at random it can become very slow.
What if your're not using curl
?
The package uses curl even if you dont
Ow, sorry. Thats great! I'll try it now Thanks
BUt why is it returning a null
value?
I used:
dd($request->input('g-recaptcha-response'));
@jonjie0317, please don't post across all different issues; it doesn't help things. Open a single ticket if you need help. Anyway, if you do dd(\Request::all())
, is there a value for g-recaptcha-response
? If not, you're not rendering the form properly.
@pjebs you don't have to use curl; that's what the driver
is there for.
@greggilbert Sorry for that. Thanks a lot for your support 👍
here is how to fix it
File: config/recaptcha.php
'driver' => 'native',
So, I have placed the reCaptcha in my login form. I click on "im not a robot" and click on the right images and it says it succeeded, but when I submit the form it returns me the message of "The Captcha field is not correct." and it also thrown and exception saying:
'Illuminate\Foundation\Validation\ValidationException' with message 'The given data failed to pass validation.' I am using "greggilbert/recaptcha" in my Laravel 5.2 project. I have set my keys and everything is working great in production and in other localhost's but not in mine.
My team and I work in the same git repository and it works for everyone but not for me. I have re-installed the plugin, also the whole composer (by deleting vendor and then composer install).
I have cleared the configuration with php artisan config:clear and I've done the composer dump-autoload and have re-publish the ServiceProvider with php artisan vendor:publish --provider="Greggilbert\Recaptcha\RecaptchaServiceProvider"
Does somebody have any idea on how to fix this? Please!