Download the PHP package astritzeqiri/g-recaptcha without Composer
On this page you can find all versions of the php package astritzeqiri/g-recaptcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download astritzeqiri/g-recaptcha
More information about astritzeqiri/g-recaptcha
Files in astritzeqiri/g-recaptcha
Package g-recaptcha
Short Description Easily add google recaptcha
License MIT
Homepage https://github.com/astritzeqiri/g-recaptcha
Informations about the package g-recaptcha
Google recaptcha for Laravel
Easily add google recaptcha in Laravel.
Requirements
- PHP >=5.4
- Laravel >= 5.0
- GuzzleHttp >= 5.3
Installation
Add astritzeqiri/g-recaptcha to your composer.json file:
And do:
Or get composer to install the package:
Configuration
Now you go and generate a new Google recaptcha on the link below:
Then you go to your .env file and set these variables
You can also change these variables on the config file on config/grecaptcha.php file.
Registering the Package
Register the service provider within the providers
array found in app/config/app.php
:
Then you need to add GRecaptcha class within the aliases
array found in app/config/app.php
:
Then you run php artisan vendor:publish to publish the start_captchas script and also the recaptcha config file.
Usage
First of all you need to call the grecaptcha scripts on the footer. The scripts are rendered only if you have an active captcha somewhere on you html.
Basic Example
Now to render a new GRecaptcha you call the render method.
If you want to get a new recaptcha instance:
Validation
When you validate a form to validate the recaptcha you use the rule grecaptcha
License
MIT