rvxlab / hcaptcha Goto Github PK
View Code? Open in Web Editor NEWThis project forked from scyllaly/hcaptcha
hCaptcha for Laravel 8.x and later
License: MIT License
This project forked from scyllaly/hcaptcha
hCaptcha for Laravel 8.x and later
License: MIT License
laravelcollective/html is deprecated and doesn’t support Laravel 11.
This will require a 6.x release
Laravel 10 will be released early February.
Ensure that this package can support Laravel 10.
HTML is currently generated in the HCaptcha class. It's better to extract them to separate views to they can be published.
Should be moved to widget.blade.php
This needs to be split into 2 files:
Should be moved to script.blade.php
Instead of needing to manually mock the display and verify calls, it's nice to be able to just call HCaptcha::fake()
and have it automatically set some reasonable defaults.
This will require the introduction of a contract:
interface HCaptchaContract
{
public function display(array $attributes = []): string;
public function displayWidget(array $attributes = []): string;
public function displaySubmit(string $formIdentifier, string $buttonText = 'submit', array $attributes = []): string;
public function renderJs(?string $lang = null, bool $hasCallback = false, string $onLoadClass = 'onloadCallBack'): string;
public function verifyResponse(string $response, ?string $clientIp = null): bool;
public function verifyRequest(Request $request): bool;
public function getJsLink(?string $lang = null, bool $hasCallback = false, string $onLoadClass = 'onloadCallBack'): string;
}
For the fake, any of the display methods can return an input with any value, so it can be rendered and form validation will succeed.
The getJsLink method can just return an empty string, that's not really important here.
The verify methods should return true by default with the option to mock that call as needed by means of a shouldVerify(bool)
or a successfullyVerifies()
and failsVerification()
pair.
Currently the only way to reference validation is using the extended validation rule.
It would be nice if we can also support validation objects as well.
I copied the example invisible widget into my application, when clicking the button it takes about 5 seconds before the captcha shows up, and it skips over my form validation.
Edit: Seems hCaptcha is just slow... Would there be a way to add a class to the button, just as disabled, when the hCaptcha is loading, or to show a loading bar.
My form still does not get validated when clicking the button, I'm using MaterializeCSS
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.