Download the PHP package middlewares/recaptcha without Composer
On this page you can find all versions of the php package middlewares/recaptcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download middlewares/recaptcha
More information about middlewares/recaptcha
Files in middlewares/recaptcha
Package recaptcha
Short Description Middleware to use Google reCAPTCHA for spam prevention
License MIT
Homepage https://github.com/middlewares/recaptcha
Informations about the package recaptcha
middlewares/recaptcha
Middleware to use google/recaptcha library for spam prevention. Returns a 403
response if the request is not valid. More info about Google reCAPTCHA.
Requirements
- PHP >= 7.2
- A PSR-7 http library
- A PSR-15 middleware dispatcher
Installation
This package is installable and autoloadable via Composer as middlewares/recaptcha.
Example
Usage
You need a secret API key for your app. You can register it at https://www.google.com/recaptcha/admin
Optionally, you can provide a Psr\Http\Message\ResponseFactoryInterface
as the second argument to create the error responses (403
). If it's not defined, Middleware\Utils\Factory will be used to detect it automatically.
ipAttribute
By default uses the REMOTE_ADDR
server parameter to get the client ip. This option allows to use a request attribute. Useful to combine with a ip detection middleware, for example client-ip:
Please see CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.
All versions of recaptcha with dependencies
google/recaptcha Version ^1.1
middlewares/utils Version ^3.0
psr/http-server-middleware Version ^1.0