PHPackages                             snipify-dev/laravel-captcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. snipify-dev/laravel-captcha

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

snipify-dev/laravel-captcha
===========================

A comprehensive Laravel package for integrating Google reCAPTCHA v2 and v3 with support for standard forms and Livewire components

1.0.5(9mo ago)048MITPHPPHP ^8.0CI failing

Since Sep 13Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/snipify-dev/larave-captcha)[ Packagist](https://packagist.org/packages/snipify-dev/laravel-captcha)[ RSS](/packages/snipify-dev-laravel-captcha/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (8)Versions (7)Used By (0)

Laravel reCAPTCHA Package
=========================

[](#laravel-recaptcha-package)

A simple, Laravel-native package for integrating Google reCAPTCHA v2 and v3 with both standard forms and Livewire components.

[![Latest Version on Packagist](https://camo.githubusercontent.com/c658c00c22ad8a30f3910e57268f6aef921d03194388453b3ef3202206fd1262/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736e69706966792d6465762f6c61726176656c2d636170746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/snipify-dev/laravel-captcha)[![Total Downloads](https://camo.githubusercontent.com/2253600933d983794bfc777c20fb52a81daa3e6aaf0884637fc9abc6dfefb42e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736e69706966792d6465762f6c61726176656c2d636170746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/snipify-dev/laravel-captcha)

Features
--------

[](#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
------------

[](#requirements)

- PHP 8.2+
- Laravel 10.x - 12.x
- Google reCAPTCHA API keys
- Livewire 3.x (for Livewire features)

Installation
------------

[](#installation)

### 1. Install the Package

[](#1-install-the-package)

```
composer require snipify-dev/laravel-captcha
```

### 2. Get reCAPTCHA Keys

[](#2-get-recaptcha-keys)

1. Visit the [Google reCAPTCHA Admin Console](https://www.google.com/recaptcha/admin)
2. Create a new site and choose your reCAPTCHA type
3. Add your domains (including localhost for development)
4. Copy the Site Key and Secret Key

### 3. Configure Environment Variables

[](#3-configure-environment-variables)

Add your reCAPTCHA keys to your `.env` file:

```
# Choose your default version
RECAPTCHA_VERSION=v3

# reCAPTCHA v3 Keys (recommended)
RECAPTCHAV3_SECRET=your_v3_secret_key_here
RECAPTCHAV3_SITEKEY=your_v3_site_key_here

# reCAPTCHA v2 Keys (optional)
RECAPTCHAV2_SECRET=your_v2_secret_key_here
RECAPTCHAV2_SITEKEY=your_v2_site_key_here
```

### 4. Clear Configuration Cache

[](#4-clear-configuration-cache)

```
php artisan config:clear
```

That's it! The package is ready to use.

Basic Usage
-----------

[](#basic-usage)

### Livewire Component

[](#livewire-component)

```
