hCaptcha blocks automated contact-form submissions. PagibleAI shows and validates the challenge outside Laravel's local environment when both keys are set.
Configure hCaptcha for PagibleAI
Create an hCaptcha account
Open the hCaptcha plans, choose an account for your traffic and support needs, and verify the email address. For a production site, use an organization-owned account rather than a personal login.
Register the hostnames
- Open the hCaptcha site settings.
- Enter a name for the PagibleAI site.
- Add every production and staging hostname that will show the form.
- Save the site with the difficulty and security settings you need.
Enter hostnames without paths. Keep test and production configurations separate when they have different access rules.
Get the sitekey and secret
Copy the public sitekey from Sites and the private siteverify secret from account settings. The sitekey appears in page markup; the secret must stay on the server. Store the secret in your deployment secret manager and rotate it if it leaks.
Add the keys to PagibleAI
Add both values to the application environment. The PagibleAI theme installer connects them to Laravel's services.hcaptcha configuration:
HCAPTCHA_SITEKEY="..."
HCAPTCHA_SECRET="..."
Run the command below after changing either value. Then restart Octane, queue workers and other long-running PHP processes.
php artisan config:clear
Test the contact form
Test on staging or production; the default contact form skips hCaptcha when Laravel runs in the local environment.
- Open the form and check that the challenge loads.
- Submit without a valid challenge; validation should reject the request.
- Complete the challenge and send a harmless test message.
- Check that the message follows the site's normal delivery path.
Troubleshooting
Why is the widget missing locally?
The default PagibleAI contact form skips hCaptcha in Laravel's local environment. Test on a staging hostname in another environment.
Why does hCaptcha reject the sitekey?
Check that HCAPTCHA_SITEKEY belongs to this site and that the current hostname is registered. Clear the configuration cache after changing it.
Why does hCaptcha report a sitekey-secret mismatch?
The sitekey and HCAPTCHA_SECRET must belong to the same hCaptcha account and site configuration.
Why does the browser block the challenge?
Check your Content Security Policy. Custom policies must allow the hCaptcha script, frame, style and connection hosts used by the default theme.
What if the secret was exposed?
Generate a new siteverify secret, deploy it as HCAPTCHA_SECRET, clear the configuration cache and restart workers. Remove the old value from logs and source history.