PyroCMS - Recaptcha Field Type
Just include this into your FormBuilder
protected $options = [
'captcha' => true
];
And configure your ReCaptcha keys in your env file
NOCAPTCHA_SITEKEY=[yoursitekey]
NOCAPTCHA_SECRET=[yoursecret]
PyroCMS - Recaptcha Field Type
License: MIT License
I was curious to get a captcha to appear on the contact form plugin in PyroCMS, but I can't get anything to output from this extension. Any guidance on getting the captcha to appear on the contact form?
Hello, I wondered that I found this extension, thank you!
I have some small issue while integration it into my site.
When I add RecaptchaValidator
into my validators of the form field:
.......
'validators' => [
'captcha' => [
'handler' => RecaptchaValidator::class,
'message' => 'The date/time format is invalid.',
],
],
........
I get this error:
Unresolvable dependency resolving [Parameter #0 [ <required> $secret ]] in class Anhskohbo\NoCaptcha\NoCaptcha
it seems it related to injection
in NoCaptcha construct method:
public function __construct(NoCaptcha $captcha, Request $request)
{
$this->captcha = $captcha;
$this->request = $request;
}
I've tried to remove it and set $this->captcha = app('captcha')
but then I get false from verifyResponse
method:
public function verifyResponse($response, $clientIp = null)
{
if (empty($response)) {
return false;
}
// Return true if response already verfied before.
if (in_array($response, $this->verifiedResponses)) {
return true;
}
$verifyResponse = $this->sendRequestVerify([
'secret' => $this->secret,
'response' => $response,
'remoteip' => $clientIp,
]);
if (isset($verifyResponse['success']) && $verifyResponse['success'] === true) {
// A response can only be verified once from google, so we need to
// cache it to make it work in case we want to verify it multiple times.
$this->verifiedResponses[] = $response;
return true;
} else {
return false;
}
}
this method returns:
^ array:2 [▼
"success" => false
"error-codes" => array:1 [▼
0 => "invalid-input-response"
]
]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.