abanoubnassem/filament-grecaptcha-field
Integrate Google reCAPTCHA into Filament forms with a simple, reusable custom field. Add spam protection to any Laravel admin panel form, configure your keys, and validate submissions through Filament’s native form workflow with minimal setup.
composer require abanoubnassem/filament-grecaptcha-field. v0.0.12 is the release that widened the constraints for Filament 5, Laravel 13 and PHP 8.4 — confirm your resolved versions with composer show abanoubnassem/filament-grecaptcha-field after install rather than assuming it pulled the newest tag.php artisan vendor:publish and pick the package's config tag — check the README for the exact tag name) so the site key, secret key, and version settings live in config/filament-grecaptcha-field.php instead of hardcoded values..env and reference them from config. Re-run php artisan config:cache after any change in production, otherwise you'll be editing a file the app never reads.GRecaptcha::make('captcha'), typically as the last field before the submit action. Confirm the exact class name and namespace against the README, since the package is pre-1.0 and the surface has moved between tags.localhost and your staging/production domains in the Google reCAPTCHA admin console. On an unregistered domain the widget usually renders but never resolves a token, which presents as an unexplained validation failure.theme, type, action, size, and so on).->required() on it, and let the package's rule do the server-side siteverify. Keep the field dehydrated so the value reaches your submit handler.action name at render time and check that same action plus a score threshold in verification. Treat a bare success: true as insufficient.Http::fake() the siteverify endpoint and return a canned success payload, or conditionally disable/omit the field in the testing and local environments via config. Never let the suite hit Google.0.0.x carries no semver promise. Pin the exact version ("0.0.12") or at minimum ~0.0.12, and read the changelog before any composer update. Minor-looking bumps in this range have changed compatibility constraints.composer why-not abanoubnassem/filament-grecaptcha-field) or as a field that silently fails to render.saved hook, an observer, or a job, the second call fails because the token is already consumed. Verify exactly once, and let the form rule own it.wire:navigate, the Google script isn't always re-executed on the new page, leaving the widget inert after client-side navigation. A full page load on the form route, or re-initialising on livewire:navigated, works around it.www.google.com/recaptcha/, www.gstatic.com/recaptcha/ and the challenge iframe origins in your Content-Security-Policy, or the widget will be blocked while the server-side validation looks fine.error-codes array from Google's siteverify response — invalid-input-secret, timeout-or-duplicate and invalid-input-response each point at a very different root cause, and the generic form error hides which one you hit.How can I help you explore Laravel packages today?