Download the PHP package esyede/hidden-recaptcha without Composer
On this page you can find all versions of the php package esyede/hidden-recaptcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download esyede/hidden-recaptcha
More information about esyede/hidden-recaptcha
Files in esyede/hidden-recaptcha
Informations about the package hidden-recaptcha
Laravel Hidden reCAPTCHA v3
Support
Laravel 8+, PHP >=7.4
.
Installation
Setup
Add ServiceProvider to the providers array in app/config/app.php
.
Configuration
Adjust your .env
file:
There are three different captcha styles you can set:
bottomright
,bottomleft
,inline
If you set
INVISIBLE_RECAPTCHA_BADGEHIDE
to true, you can hide the badge logo.You can see the binding status of those catcha elements on browser console by setting
INVISIBLE_RECAPTCHA_DEBUG
as true.
Usage
Before you render the captcha, please keep those notices in mind:
render()
orrenderHTML()
function needs to be called within a form element.- You have to ensure the
type
attribute of your submit button has to besubmit
. - There can only be one submit button in your form.
Display reCAPTCHA in Your View
With custom language support:
Usage with Javascript frameworks like VueJS:
The render()
process includes three distinct sections that can be rendered separately incase you're using the package with a framework like VueJS which throws console errors when <script>
tags are included in templates.
You can render the polyfill (do this somewhere like the head of your HTML:)
You can render the HTML using this following, this needs to be INSIDE your <form>
tag:
And you can render the neccessary <script>
tags including the optional language support by using:
Validation
Add 'g-recaptcha-response' => 'required|captcha'
to rules array.
CodeIgniter 3.x
set in application/config/config.php :
add lines in application/config/config.php :
In controller, use:
In view, in your form:
Then back in your controller you can verify it:
Without Laravel or CodeIgniter
Checkout example below:
Take Control of Submit Function
Use this function only when you need to take all control after clicking submit button. Recaptcha validation will not be triggered if you return false in this function.
Customize Submit Function
If you want to customize your submit function, for example: doing something after click the submit button or changing your submit to ajax call, etc.
The only thing you need to do is to implement _submitEvent
in javascript
Here's an example to use an ajax submit (using jquery selector)
All versions of hidden-recaptcha with dependencies
illuminate/support Version ^8.0
illuminate/view Version ^8.0
guzzlehttp/guzzle Version ^7.0