Download the PHP package snipify-dev/laravel-captcha without Composer
On this page you can find all versions of the php package snipify-dev/laravel-captcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download snipify-dev/laravel-captcha
More information about snipify-dev/laravel-captcha
Files in snipify-dev/laravel-captcha
Package laravel-captcha
Short Description A comprehensive Laravel package for integrating Google reCAPTCHA v2 and v3 with support for standard forms and Livewire components
License MIT
Informations about the package laravel-captcha
Laravel reCAPTCHA Package
A simple, Laravel-native package for integrating Google reCAPTCHA v2 and v3 with both standard forms and Livewire components.
Features
- ๐ Laravel Validation Rules: Native Laravel validation with ValidationRule support
- โก Simple Integration: Works out of the box with minimal configuration
- ๐ก๏ธ Multi-Version Support: reCAPTCHA v2 and v3
- ๐ฏ Livewire Ready: Built for Livewire components
- ๐งช Testing Friendly: Automatically disabled in testing environments
Requirements
- PHP 8.2+
- Laravel 10.x - 12.x
- Google reCAPTCHA API keys
- Livewire 3.x (for Livewire features)
Installation
1. Install the Package
2. Get reCAPTCHA Keys
- Visit the Google reCAPTCHA Admin Console
- Create a new site and choose your reCAPTCHA type
- Add your domains (including localhost for development)
- Copy the Site Key and Secret Key
3. Configure Environment Variables
Add your reCAPTCHA keys to your .env file:
4. Clear Configuration Cache
That's it! The package is ready to use.
Basic Usage
Livewire Component
Livewire View
Traditional Controller
Components
Livewire Field Component
Include Scripts
Add this to your layout before closing </body> tag:
Validation Rules
Testing
The package automatically disables validation in testing environments:
Troubleshooting
Common Issues
"Site key not found" Error
Validation Always Fails
- Check your secret key is correct in
.env - Verify the site key matches your domain
- Enable fake mode for development:
RECAPTCHA_FAKE_DEVELOPMENT=true
JavaScript Errors
- Include
<x-captcha-script />before</body> - Check browser console for errors
Livewire Integration
- Ensure your component has
public $captchaToken = ''; - Use
wire-model="captchaToken"in the component
Configuration
Optionally publish the config file for advanced customization:
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-captcha with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/validation Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^8.0|^9.0|^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0