Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from biscolab/v1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
biscolab committed Apr 21, 2017
2 parents 7519f2f + 6a1b1d7 commit 8b6406f
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ Simple Google ReCaptcha package for Laravel 5
## Installation

You can install the package via composer:

```sh
composer require biscolab/laravel-recaptcha
```

The service **provider** must be registered in `config/app.php`:

```php
'providers' => [
...
Expand All @@ -33,19 +30,16 @@ php artisan vendor:publish --provider="Biscolab\ReCaptcha\ReCaptchaServiceProvid

### Add your API Keys
Open `config/recaptcha.php` configuration file and set `api_site_key` and `api_secret_key`:

```php
return [
'api_site_key' => 'YOUR_API_SITE_KEY',
'api_secret_key' => 'YOUR_API_SECRET_KEY',
];
```

For more invermation about Site Key and Secret Key please visit [Google RaCaptcha developer documentation](https://developers.google.com/recaptcha/docs/start)

### Customize error message
Before starting please add validation recaptcha message to `resources/lang/[LANG]/validation.php` file

```php
return [
...
Expand All @@ -58,7 +52,6 @@ return [
### Embed in Blade

Insert `{!!ReCaptcha::htmlScriptTagJsApi()!!}` before closing `</head>` tag

```blade
<!DOCTYPE html>
<html>
Expand All @@ -69,7 +62,6 @@ Insert `{!!ReCaptcha::htmlScriptTagJsApi()!!}` before closing `</head>` tag
```

After you have to insert `{!!ReCaptcha::htmlFormSnippet()!!}` inside the form where you want to use the field `g-recaptcha-response`

```blade
<form>
...
Expand All @@ -80,15 +72,13 @@ After you have to insert `{!!ReCaptcha::htmlFormSnippet()!!}` inside the form wh
## Verify submitted data

Add **recaptcha** to your rules

```php
$v = Validator::make(request()->all(), [
'g-recaptcha-response' => 'recaptcha',
]);
```

Print form errors

```php
dd($v->errors());
```
Expand Down

0 comments on commit 8b6406f

Please sign in to comment.