Download the PHP package martian/laracaptcha without Composer

On this page you can find all versions of the php package martian/laracaptcha. 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 laracaptcha

LaraCaptcha

Latest Version on Packagist Total Downloads GitHub Actions

A Laravel package to seamlessly integrate Google reCAPTCHA v3, v2 or hCAPTCHA into your application forms or Restful API.

Image 1
hCaptcha
Image 2
reCaptcha

Supported Captcha Services

Service Version Type Supported
Google reCAPTCHA v3 - ✅ Yes
Google reCAPTCHA v2 Checkbox ✅ Yes
Google reCAPTCHA v2 Invisible ✅ Yes
hCAPTCHA - Checkbox ✅ Yes
hCAPTCHA - Invisible ✅ Yes

Installation

Note: This package requires PHP 7.4 or higher.

You can install the package via composer:

Register Service Provider

Add the following to the providers array in config/app.php:

Publish Configuration File

Publish the configuration file using the following command:

Configuration

The configuration file is located at config/laracaptcha.php. The following options are available:

reCAPTCHA v2 Configuration

reCAPTCHA v3 Configuration

hCAPTCHA Configuration

These are the test keys we use by default. You should not use them in production!

Usage

To display captcha in your form, follow the steps below according to the captcha configuration you are using.

reCAPTCHA v2 Checkbox & Invisible

Initializing JavaScript

Add the following to the <head> section of your page:

With other options in Google reCaptcha v2 Checkbox dox

Note: The first parameter is the callback function name, the second is the rendering mode (explicit or onload), and the third is the language code from doc

Displaying Captcha Widget - Checkbox

Add the following to your form:

With other options in Google reCaptcha v2 Checkbox dox

Note: The parameter is an array of attributes for the widget

Displaying Captcha Widget - Invisible

Add the following to your form:

Note: The first parameter is the form identifier, the second is the button label (Submit Button), and the third is an array of attributes for the widget, see doc. Add the formIdentifier value as the id in the form element

Validating Captcha

Add the following to your validation rules:

You can also use the rule in the Validator facade:

Add Custom Validation Message

Add the following to your validation messages:

Or you can change the default message in config/laracaptcha.php:

reCAPTCHA v3

Initializing JavaScript

Add the following to the <head> section of your page:

With other options in Google reCaptcha v3 dox

Displaying Captcha Widget

Add the following to your form:

With other options in Google reCaptcha v3 dox

Note: The parameter is an array of attributes for the widget, see doc for actions type

hCAPTCHA v2 Checkbox & Invisible

Initializing JavaScript

Add the following to the <head> section of your page:

With other options in hCAPTCHA dox

Note: The first parameter is the callback function name, the second is the rendering mode (onload or explicit), the third is the language code from doc, and the fourth is the recaptchacompat option

Displaying Captcha Widget - Checkbox

Add the following to your form:

With other options in hCAPTCHA dox

Note: The parameter is an array of attributes for the widget

Displaying Captcha Widget - Invisible

Add the following to your form, see documentation for invisible hcaptcha:

Note: The first parameter is the form identifier, the second is the button label (Submit Button), and the third is an array of attributes for the widget, see doc

Validating Captcha

Add the following to your validation rules:

You can also use the rule in the Validator facade:

Add Custom Validation Message

Add the following to your validation messages:

Or you can change the default message in config/laracaptcha.php:

For other configuration go through the config/laracaptcha.php file.

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laracaptcha with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
illuminate/support Version ^10.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 martian/laracaptcha contains the following files

Loading the files please wait ....