henriqueramos / recaptcha_middleware
Laravel reCaptcha Middleware it's a Composer package created to help us to validate reCaptcha payloads during the initial steps of request lifecycle.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
pkg:composer/henriqueramos/recaptcha_middleware
Requires
- php: >=7.2
- google/recaptcha: ^1.2
- laravel/framework: >=5.7
Requires (Dev)
This package is not auto-updated.
Last update: 2025-10-30 01:51:28 UTC
README
=========
Laravel reCaptcha Middleware it's a Composer package created to help us to validate reCaptcha payloads during the initial steps of request lifecycle.
Installation
Add the following line to the require section of composer.json:
{
"require": {
"henriqueramos/recaptcha_middleware": "dev-master"
}
}
Setup
- Run
php artisan vendor:publish --provider="RamosHenrique\reCaptchaMiddleware". - In your .env, enter your reCAPTCHA private key as value for
RECAPTCHA_MIDDLEWARE_SECRET_KEYandRECAPTCHA_MIDDLEWARE_RESPONSE_TYPEasjsonorhtml.
Usage
Add into your selected routes the middleware recaptcha_middleware.
$this->router->post( 'myProtectedRoute', [ 'as' => 'my.protected.route', 'uses' => 'ProtectedRouteController@necessaryMethod', ] ) ->middleware('recaptcha_middleware');