Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanDaDeng authored Jan 25, 2019
1 parent af72d23 commit 0c291e5
Showing 1 changed file with 43 additions and 66 deletions.
109 changes: 43 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Please check Google site: https://developers.google.com/recaptcha/docs/faq
- Support custom implementation on config interface
- Support custom implementation on request method interface
- Fully supported Vue component
- IP skipp list supported

## Requirement

Expand Down Expand Up @@ -229,72 +230,6 @@ Include Template script in your bottom/header of your page, params should follow
#### Example Usage

``` html

{{--if laravel version <=5.6, please use {{ csrf_field() }}--}}

<form method="POST" action="/verify">
@csrf
<div id="contact_us_id"></div>
<input type="submit" value="submit">
<div>
<small>
This site is protected by reCAPTCHA and the Google
<a href="https://policies.google.com/privacy">Privacy Policy</a> and
<a href="https://policies.google.com/terms">Terms of Service</a> apply.
</small>
</div>
</form>

{!! GoogleReCaptchaV3::render([
'contact_us_id'=>'contact_us'
]) !!}

```

The backend request will receive a value for 'g-recaptcha-response', please take a look at Sample Use Case and Facade usage sections.

### Badge Display

If your settings were not reflected, please run php artisan config:cache to clear cache.

Inline

1. Go to config file, and set
``` PHP
[
...
'inline' => true
...
]
```
2. Badge will be displayed as inline format within the form.


Invisible

1. Set inline as true as well
2. Modify your div with style display:none
3. Refer to Google official site: https://developers.google.com/recaptcha/docs/faq
, you need to include the following text:
``` HTML
This site is protected by reCAPTCHA and the Google
<a href="https://policies.google.com/privacy">Privacy Policy</a> and
<a href="https://policies.google.com/terms">Terms of Service</a> apply.
```

Corner

1. Set inline as false
2. Your badge will be shown in the bottom right side.

Custom

1. Set inline as true
2. Do Styling/CSS on its div element


### Blade Use Case

Register your action in config, also enable score and set up your own site key and secret key:
``` php
'setting' => [
Expand Down Expand Up @@ -349,8 +284,50 @@ Create your form in index.blade.php:
{!! GoogleReCaptchaV3::render(['contact_us_id'=>'contact_us', 'signup_id'=>'signup']) !!}
```

The backend request will receive a value for 'g-recaptcha-response'.

Go to /index and click submit button on contact us form and you should see an error message that 'Score does not meet the treshhold' because the threshold >2. You can play around the controller to see all outcomes. Importantly, you need to wait the script to be loaded before clicking the submit button.

### Badge Display

If your settings were not reflected, please run php artisan config:cache to clear cache.

Inline

1. Go to config file, and set
``` PHP
[
...
'inline' => true
...
]
```
2. Badge will be displayed as inline format within the form.


Invisible

1. Set inline as true as well
2. Modify your div with style display:none
3. Refer to Google official site: https://developers.google.com/recaptcha/docs/faq
, you need to include the following text:
``` HTML
This site is protected by reCAPTCHA and the Google
<a href="https://policies.google.com/privacy">Privacy Policy</a> and
<a href="https://policies.google.com/terms">Terms of Service</a> apply.
```

Corner

1. Set inline as false
2. Your badge will be shown in the bottom right side.

Custom

1. Set inline as true
2. Do Styling/CSS on its div element


## Vue Usage (Pacakge version >= 2.2.0) <a name="vue-usage" />

The package provides a lightweight vue component. You need to publish the vue component before playing around it.
Expand Down

0 comments on commit 0c291e5

Please sign in to comment.