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

ActiveLibrary

thashendran/laravel-recaptcha
=============================

Easily add reCAPTCHA to your Laravel projects

08PHP

Since Apr 19Pushed 2y ago2 watchersCompare

[ Source](https://github.com/e-prop/laravel-recaptcha)[ Packagist](https://packagist.org/packages/thashendran/laravel-recaptcha)[ RSS](/packages/thashendran-laravel-recaptcha/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel reCAPTCHA
=================

[](#laravel-recaptcha)

[![Build Status](https://camo.githubusercontent.com/1d1ce7a997e702e680787c7e81023e0d5ab8738ae5d41892ffc8ad527d7f24fa/68747470733a2f2f7472617669732d63692e6f72672f61726a6173636f2f6c61726176656c2d7265636170746368612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/arjasco/laravel-recaptcha)

This package allows you to easily add reCAPTCHA to your Laravel projects.

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

[](#installation)

Install with composer:

```
composer require arjasco/laravel-recaptcha

```

If your Laravel version doesn't support auto discovery, add the service provider to your `app.php` configuration.

```
'providers' => [
    ...
    Arjasco\LaravelRecpatcha\RecaptchaServiceProvider::class,
],
```

Publish the configuration file to your project.

`php artisan vendor:publish --provider="Arjasco\LaravelRecaptcha\RecaptchaServiceProvider"`

Add your site key and secret to `recaptcha.php`.

```
 return [
     'sitekey' => env('RECAPTCHA_SITEKEY'),
     'secret' => env('RECAPTCHA_SECRET')
 ]
```

Usage
-----

[](#usage)

### Form embed

[](#form-embed)

Use the helper function `recaptcha()` to embed the HTML within your form.

```

    Send
    {!! recaptcha() !!}

```

Alternatively, if you are using Blade, you can use the `@recaptcha` directive

```

    ...
    @recaptcha

```

You may also pass a load of options to the function to further customise the embed.

```

    ...
    {!! recaptcha(['theme' => 'dark', 'size' => 'compact']) !!}

    @recaptcha(['theme' => 'dark', 'size' => 'compact'])

```

See [here](https://developers.google.com/recaptcha/docs/display) for a table of more options. Omit the `data-` part of each options when using in the options array.

### Verification

[](#verification)

Add the `recaptcha` rule to your validator on the request you wish to verify.

```
