ARCANEDEV / noCAPTCHA

:passport_control: Helper for Google's new noCAPTCHA (reCAPTCHA v2 & v3)
MIT License
359 stars 56 forks source link

Method [validateCaptcha] does not exist. #67

Closed rwnet closed 6 years ago

rwnet commented 6 years ago

Hello.

Installed everything according to the documentation, but there is an error "Method [validateCaptcha] does not exist" after submitting form. I'm trying to use recaptcha on Laravel default generated login form.

Couldn't figure out yet what goes wrong exactly...

Tried to manually describe service providers and alias - nothing changed.

arcanedev-maroc commented 6 years ago

For the latest release, use the new Rule class instead of 'captcha' rule for validation:

use Arcanedev\NoCaptcha\Rules\CaptchaRule;

$validator = Validator::make(request()->all(), [
    // Other validation rules...
    'g-recaptcha-response' => ['required', new CaptchaRule],
]);
rwnet commented 6 years ago

Thank you. Now everything has worked for me!