Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

No Captcha Laravel Package

anhskohbo/no-captcha

Laravel package to integrate Google reCAPTCHA “No CAPTCHA” into your app. Provides helpers to render the JS, display normal or invisible widgets, and validate responses. Supports Laravel auto-discovery, with simple .env configuration for site key and secret.

View on GitHub
Deep Wiki
Context7

No CAPTCHA reCAPTCHA For Laravel.

Frequently asked questions about No Captcha
How do I install and set up anhskohbo/no-captcha in Laravel 5.5+?
Run `composer require anhskohbo/no-captcha`, then add your Google reCAPTCHA keys (`NOCAPTCHA_SECRET` and `NOCAPTCHA_SITEKEY`) to your `.env` file. Laravel 5.5+ auto-discovers the package, so no manual registration in `app.php` is needed.
Can I use invisible reCAPTCHA with this package?
Yes, use `NoCaptcha::displaySubmit()` in your Blade template to render an invisible reCAPTCHA widget. This is ideal for high-conversion forms like checkouts, as it triggers validation only on submission.
How do I validate reCAPTCHA responses in Laravel forms?
Add the `required|captcha` rule to your Form Request or validation array. The package integrates with Laravel’s validator, so no extra logic is needed in your controller.
Does this package work with Laravel 4?
No, this package is designed for Laravel 5.5+. For Laravel 4, use the `v1` branch of the package, which requires manual service provider and facade registration.
How can I customize the reCAPTCHA widget appearance?
Pass an array of attributes to `NoCaptcha::display()`, such as `['data-theme' => 'dark', 'data-size' => 'compact']`. This allows you to match the widget’s theme, size, and other Google-supported parameters to your app’s design.
What if Google’s reCAPTCHA API changes or breaks?
Monitor Google’s reCAPTCHA release notes for updates. If needed, fork the package or pin a specific version in `composer.json` (e.g., `^3.7`). The package’s modular design makes it easier to swap out reCAPTCHA for alternatives like hCaptcha.
How do I test forms with reCAPTCHA in PHPUnit?
Mock the `NoCaptcha` facade in your tests: `NoCaptcha::shouldReceive('verifyResponse')->andReturn(true)`. For validation tests, use hidden input fallbacks or disable CAPTCHA checks in test environments via `.env` overrides.
What should I do if users report ad blockers breaking reCAPTCHA?
Implement a server-side fallback, such as manual CAPTCHA or IP-based rate-limiting, for users who disable JavaScript. Test with ad blockers like uBlock Origin in your QA environment to catch these issues early.
Can I enable/disable reCAPTCHA per form or route?
Yes, use middleware to conditionally validate reCAPTCHA tokens. For example, create a `VerifyRecaptcha` middleware to wrap routes or forms where CAPTCHA is required, or disable it via configuration for specific forms.
How do I handle reCAPTCHA validation for AJAX or API requests?
Use middleware like `VerifyRecaptcha` to validate tokens on API routes. Ensure your AJAX requests include the `g-recaptcha-response` token in the payload, and validate it using `NoCaptcha::verifyResponse($token)` in your controller or middleware.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata