Skip to main content
Back to packages
1,845 GitHub stars

anhskohbo/no-captcha

View on GitHub

Description

No CAPTCHA reCAPTCHA For Laravel

With default options :

{!! NoCaptcha::renderJs() !!}

With language support or onloadCallback option :

{!! NoCaptcha::renderJs('fr', true, 'recaptchaCallback') !!}

Display reCAPTCHA

Default widget :

{!! NoCaptcha::display() !!}

With custom attributes (theme, size, callback ...) :

{!! NoCaptcha::display(['data-theme' => 'dark']) !!}

Invisible reCAPTCHA using a submit button:

{!! NoCaptcha::displaySubmit('my-form-id', 'submit now!', ['data-theme' => 'dark']) !!}

Notice that the id of the form is required in this method to let the autogenerated callback submit the form on a successful captcha verification.

Validation

Add 'g-recaptcha-response' => 'required|captcha' to rules array :

$validate = Validator::make(Input::all(), [
'g-recaptcha-response' => 'required|captcha'
]);

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.