Download the PHP package nguyendachuy/laravel-recaptcha3 without Composer
On this page you can find all versions of the php package nguyendachuy/laravel-recaptcha3. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nguyendachuy/laravel-recaptcha3
More information about nguyendachuy/laravel-recaptcha3
Files in nguyendachuy/laravel-recaptcha3
Package laravel-recaptcha3
Short Description This library provides support for Google reCAPTCHA v3 in Laravel. This library makes it easy to add reCAPTCHA to your Laravel application to protect against spam and bots.
License
Homepage https://github.com/nguyendachuy/laravel-recaptcha3
Informations about the package laravel-recaptcha3
Google reCAPTCHA v3 in Laravel
This library provides support for Google reCAPTCHA v3 in Laravel. This library makes it easy to add reCAPTCHA to your Laravel application to protect against spam and bots.
Table of Contents
- Installation
- Configuration
- Usage
- Blade Directives
- Form Integration
- Validation
- Using the Facade
- Advanced Features
- Auto Token Refresh
- Error Handling
- Custom Attributes
- Action-specific Validation
- Changelog
- Credits
- License
Installation
You can install the package via composer:
You can publish config file with:
This is the contents of the published config file:
References
Google reCAPTCHA documentation: https://developers.google.com/recaptcha/docs/v3
Usage
Using the Facade
You can also use the Recaptcha
facade directly in your controllers or other classes:
Blade directive
This directive imports the recaptcha JavaScript library and configures it with your site key.
Use on the form
Use on the validator
Optimizing Views
Credits
- NguyenDacHuy
- All Contributors
Advanced Features
Auto Token Refresh
reCAPTCHA tokens expire after 2 minutes. This library now automatically refreshes tokens every 90 seconds to ensure your forms always have valid tokens.
Error Handling
Improved error handling with detailed logging when verification fails, making it easier to debug issues.
Custom Attributes
You can now add custom HTML attributes to the reCAPTCHA input field:
Action-specific Validation
You can specify different actions for different forms and validate them accordingly:
Changelog
v1.1.0 (2025-05-26)
- Added auto token refresh to prevent token expiration
- Improved error handling with detailed logging
- Added support for custom HTML attributes
- Fixed Facade binding issue
- Added support for action-specific validation
- Enhanced security with proper input sanitization
v1.0.0 (2023)
- Initial release
Support
Please feel free to contact me if you find any bug or create an issue for that!.
License
The MIT License (MIT). Please see License File for more information.