PHPackages                             guiliredu/laravel-simple-recaptcha - 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. guiliredu/laravel-simple-recaptcha

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

guiliredu/laravel-simple-recaptcha
==================================

Simple Google reCAPTCHA v2 validation and blade directive

v0.0.0.1(6y ago)111MITPHPPHP ^7.1

Since Jul 23Pushed 6y agoCompare

[ Source](https://github.com/guiliredu/laravel-simple-recaptcha)[ Packagist](https://packagist.org/packages/guiliredu/laravel-simple-recaptcha)[ Docs](https://github.com/guiliredu/laravel-simple-recaptcha)[ RSS](/packages/guiliredu-laravel-simple-recaptcha/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Simple Google reCAPTCHA v2 validation and blade directive
=========================================================

[](#simple-google-recaptcha-v2-validation-and-blade-directive)

[![Latest Version on Packagist](https://camo.githubusercontent.com/26a08e7d36c8dd07b7044dd94a11a180e7900951aa1ca7f9a48af7355d7affc1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6775696c69726564752f6c61726176656c2d73696d706c652d7265636170746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/guiliredu/laravel-simple-recaptcha)[![Build Status](https://camo.githubusercontent.com/cadfeb22513c3613dadef54b58eb42c1c96b24a9e8c773f2ed18d1cae53ed466/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6775696c69726564752f6c61726176656c2d73696d706c652d7265636170746368612f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/guiliredu/laravel-simple-recaptcha)[![Quality Score](https://camo.githubusercontent.com/05a5549ac9412778ab392c01a06d7065a3ce1fe2113113d4e08e1eededfd1d1d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6775696c69726564752f6c61726176656c2d73696d706c652d7265636170746368612e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/guiliredu/laravel-simple-recaptcha)[![Total Downloads](https://camo.githubusercontent.com/87db852d48a0a996c1858fe55241f90a9030e71532dc8b15d64a7829b1fba796/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6775696c69726564752f6c61726176656c2d73696d706c652d7265636170746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/guiliredu/laravel-simple-recaptcha)

This package provides a simple reCAPTCHA v2 validation and blade directive to be user with Laravel applications.

Learn more about reCAPTCHA:

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

[](#installation)

You can install the package via composer:

```
composer require guiliredu/laravel-simple-recaptcha
```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

After intalling the package, publish the config file with the command:

```
php artisan vendor:publish --provider=Guiliredu\LaravelSimpleRecaptcha\RecaptchaServiceProvider
```

This will place an recaptcha.php file in the config folder. You can now configure your .env file with the recaptcha parameters:

```
RECAPTCHA_KEY=...
RECAPTCHA_SECRET=...
```

### Blade input and button

[](#blade-input-and-button)

You can use the blade files to include and render the recaptcha on your form. As today, this package has 2 ways to render the recaptcha:

**Checkbox**

This will render the classic "im not a robot" checkbox to the user to click.

```
@include('recaptcha::input')
```

You can pass and array of options as a second parameter to the include directive:

```
@include('recaptcha::input', ['size' => 'normal', 'theme' => 'light', 'tabindex' => 0, 'callback' => 'callback'])
```

**Button**

This will render a button with an invisible reCAPTCHA check - You will need to use a callback js function to submit the form.

```
@include('recaptcha::button', ['callback' => 'jsFunctionToCall'])
```

### Backend validation

[](#backend-validation)

To validate the reCAPTCHA you can use our custom request rule:

```
class StoreController extends Controller
{
    public function store(Request $request)
    {
        $this->validate($request,
            ['g-recaptcha-response' => 'recaptcha'],
            ['recaptcha' => trans('recaptcha::validation.invalid')]
        );
    }
}
```

We provide some helper methods to run simple validations:

```
use Guiliredu\LaravelSimpleRecaptcha\Recaptcha;
...

dd(Recaptcha::isRequestValid($request)); // true|false
dd(Recaptcha::isValid($request->input('g-recaptcha-response'))); // true|false
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please open an issue in this repo issue tracker.

Credits
-------

[](#credits)

- [Guilherme Redu](https://github.com/guiliredu)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2485d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1382708?v=4)[Guilherme Dias Redü](/maintainers/guiliredu)[@guiliredu](https://github.com/guiliredu)

---

Top Contributors

[![guiliredu](https://avatars.githubusercontent.com/u/1382708?v=4)](https://github.com/guiliredu "guiliredu (2 commits)")

---

Tags

google-recaptchalaravelphprecaptcharecaptchaguiliredularavel-simple-recaptcha

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/guiliredu-laravel-simple-recaptcha/health.svg)

```
[![Health](https://phpackages.com/badges/guiliredu-laravel-simple-recaptcha/health.svg)](https://phpackages.com/packages/guiliredu-laravel-simple-recaptcha)
```

###  Alternatives

[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
