Download the PHP package timehunter/laravel-google-recaptcha-v2 without Composer

On this page you can find all versions of the php package timehunter/laravel-google-recaptcha-v2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-google-recaptcha-v2

Laravel Package for Google reCAPTCHA v2

Latest Version on Packagist Total Downloads Coverage Status Build

Welcome all tickets (features/questions/bugs/improvements), I will respond to all tickets within 48 hours.

This is a package for Google reCAPTCHA v2.

If you want to use v3, please go to: https://github.com/RyanDaDeng/laravel-google-recaptcha-v3

DEMO

Checkbox

Invisible - hidden

Invisible - Inline

Corner

Description

A Laravel package for Google reCAPTCHA v2.

If you want to make your own font-end template, you have full access to modify template file, so you can customise your own template by reading through Google official guide for either invisible badge or inline checkbox. https://developers.google.com/recaptcha/docs/display

Features

Requirement

This package requires the following dependencies:

Installation

Via Composer

If your Laravel framework version <= 5.4, please register the service provider in your config file: /config/app.php, otherwise please skip it.

And also

If your Laravel framework version is >= 5.5, just run the following command to publish config.

Optional: if you want to modify or customise your own template, you can publish a default view first, and change 'template' in config file:

After installation, you should see a googlerecaptchav2/template.blade under views folder and googlerecaptchav2.php in your app/config folder.

Basic Usage

Setting up your Google reCAPTCHA details in config file

Please register all details on host_name, site_key, secret_key and site_verify_url.

For more details please check comments in config file.

Display reCAPTCHA v2

Note: for styling with reCAPTCHA v2 badge, the official site does not support it. You can still customise it on its div element if you want.

Blade

Include div with an ID inside your form, e.g.

Include Template script in your bottom/header of your page, e.g.

Example Usage

The backend request will receive a value for 'g-recaptcha-response', please take a look at Sample Use Case and Facade usage sections.

Badge Display

Importance: you can always make your own template, just assign your template in config:

Checkbox

  1. Go to config file, and set

  2. Badge will be displayed as checkbox format within the form.

Invisible - inline

  1. Set size as invisible

  2. Set badge as inline or bottomright or bottomleft

Invisible - hidden

  1. Set size as invisible

  2. Modify your div with style display:none
  3. Refer to Google official site: https://developers.google.com/recaptcha/docs/faq , you need to include the following text:

Corner

  1. Set size as invisible

  2. Set badge as bottomright/bottomleft

Validation Class (Only support Laravel >= 5.5)

You can use provided Validation object to verify your reCAPTCHA.

Facade Usage

You can also directly use registered service by calling the following method.

Example Usage

Sample Use Case

  1. Register your action in config, also enable score and set up your own site key and secret key:

  2. Register two routes in web.php

  3. Create two functions in controller:

  4. Create your form in index.blade.php:

Advanced Usage

Custom implementation on Template

After publish views, a blade file created under googlerecaptchaV2, you can customise it and change template value in config file, e.g. if your template is saved in resources/views/test/template, you should put values as below:

Custom implementation on Config

For some users, they might store the config details in their own storage e.g database. You can create your own class and implement:

Remember to register it in your own service provider

Custom implementation on Request method

The package has two default options to verify: Guzzle and Curl, if you want to use your own request method, You can create your own class and implement

Remember to register it in your own service provider

Contributers

@markheramis

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

MIT. Please see the license file for more information.


All versions of laravel-google-recaptcha-v2 with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2.5 || ^8.0
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package timehunter/laravel-google-recaptcha-v2 contains the following files

Loading the files please wait ....