Download the PHP package blissjaspis/laravel-recaptcha without Composer

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

Laravel ReCAPTCHA

Laravel ReCAPTCHA is a simple package to embed Google reCAPTCHA in your application.

What is reCAPTCHA?

Google developers says: "reCAPTCHA protects you against spam and other types of automated abuse. Here, we explain how to add reCAPTCHA to your site or application."

You can find further info at Google reCAPTCHA Developer's Guide

reCAPTCHA available versions

At this moment there are 3 versions available (for web applications):

Get your key first!

First of all you have to create your own API keys here

Follow the instructions and at the end of the process you will find Site key and Secret key. Keep them close..you will need soon!

Requirements

Dependency Version
PHP ^8.2
Laravel ^11.0, ^12.0, ^13.0

Installation

You can install the package via composer:

The service provider will be automatically registered.

You can publish the config file with:

This will create a config/recaptcha.php file in your app that you can modify to set your configuration.

Set your API Keys

Open .env file and set RECAPTCHA_SITE_KEY and RECAPTCHA_SECRET_KEY:

RECAPTCHA_SKIP_IP (not required, CSV format) allows you to add a list of IP/CIDR to whitelist.

Configuration

Open config/recaptcha.php configuration file to set your default version and other options. All options are documented inside the configuration file.

!!! IMPORTANT !!! Every time you change your configuration, run php artisan config:cache to apply the changes.

Usage

Customize error message

For v2 and invisible reCAPTCHA, you can customize the validation error message. Add your message to the resources/lang/[LANG]/validation.php file:

ReCAPTCHA v2 Checkbox

  1. Embed in Blade

    Insert {!! htmlScriptTagJsApi() !!} helper before closing </head> tag in your template.

    Inside your form, use the {!! htmlFormSnippet() !!} helper.

  2. Verify submitted data

    Add recaptcha to your validation rules:

ReCAPTCHA v2 Invisible

  1. Embed in Blade

    Insert {!! htmlScriptTagJsApi() !!} before closing </head> tag. The form requires an ID that matches the one in your config/recaptcha.php. By default, it's blissjaspis-recaptcha-invisible-form. You can get it with getFormId().

    Use the {!! htmlFormButton('Submit') !!} helper to generate the submit button.

  2. Verify submitted data

    The validation rule is the same as for v2 checkbox.

ReCAPTCHA v3

  1. Embed in Blade

    Insert {!! htmlScriptTagJsApi() !!} before closing </head> tag. You need to pass some configuration.

    The configuration keys are:

    • action: The action name for reCAPTCHA v3.
    • callback_then: Javascript function to call on success.
    • callback_catch: Javascript function to call on error.
    • custom_validation: Your own Javascript validation function.
  2. Handling validation

    The package provides a built-in Javascript validation system that makes an AJAX call to the validation route. You can define callback_then and callback_catch functions to handle the response.

    Alternatively, you can provide a custom_validation function to handle the token yourself.

License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-recaptcha with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/routing Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.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 blissjaspis/laravel-recaptcha contains the following files

Loading the files please wait ...