Skip to content

Commit 113bc1c

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 81d3ff0 + 9922705 commit 113bc1c

File tree

3 files changed

+67
-84
lines changed

3 files changed

+67
-84
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 RyanDaDeng
3+
Copyright (c) 2019 RyanDaDeng
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 60 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ I guarantee that bugs, issues, features and changes will be responded in 48 hour
1717

1818
If you want to use v2, please go to: https://github.com/RyanDaDeng/laravel-google-recaptcha-v2
1919

20-
I will be super happy if you think this package is good and also star me. ^.^
20+
Update: Vue component is ready for production usage. Please upgrade package version to ~2.2.0
2121

22-
PS: For Vue component, it will be polished in the near future, however, the basic version works fine, feel free to create ticket if you encounter any issues.
22+
A star would be a nice encouragement. ^.^
2323

2424
# Table of Contents
25-
0. [Configurations](#settings)
26-
1. [Facade Usage](#facade-usage)
27-
2. [Blade Usage](#blade-basic-usage)
28-
3. [Vue Usage](#vue-usage)
29-
4. [Validation](#validation-class)
30-
5. [Advanced Usage](#advanced-usage)
31-
6. [Contributors](#contributors)
25+
1. [Installation](#installation)
26+
2. [Configurations](#settings)
27+
3. [Facade Usage](#facade-usage)
28+
4. [Blade Usage](#blade-basic-usage)
29+
5. [Vue Usage](#vue-usage)
30+
6. [Validation](#validation-class)
31+
7. [Advanced Usage](#advanced-usage)
32+
8. [Contributors](#contributors)
3233

3334
# DEMO
3435

@@ -56,13 +57,15 @@ Please check Google site: https://developers.google.com/recaptcha/docs/faq
5657

5758
## Features
5859

60+
- High Test coverage, safe and easy to use
5961
- Score Comparision
60-
- Support invisible, global and inline badge style
62+
- Support invisible, corner and inline badge style
6163
- Support multiple reCAPTCHA on the same page for different forms
6264
- Support multiple actions to be placed on the same page
6365
- Support custom implementation on config interface
6466
- Support custom implementation on request method interface
65-
67+
- Fully supported Vue component
68+
- IP skip list supported
6669

6770
## Requirement
6871

@@ -76,13 +79,12 @@ This package requires the following dependencies:
7679

7780
- Please ensure that you have read basic information from Google reCAPTCHA v3.
7881

79-
## Installation
80-
82+
## Installation <a name="installation" />
8183

8284
Via Composer
8385

8486
``` sh
85-
$ composer require timehunter/laravel-google-recaptcha-v3 "~2.0.0" -vvv
87+
$ composer require timehunter/laravel-google-recaptcha-v3 "~2.2.0" -vvv
8688
```
8789

8890
If your Laravel framework version <= 5.4, please register the service provider under your config file: /config/app.php, otherwise please skip it.
@@ -229,72 +231,6 @@ Include Template script in your bottom/header of your page, params should follow
229231
#### Example Usage
230232

231233
``` html
232-
233-
{{--if laravel version <=5.6, please use {{ csrf_field() }}--}}
234-
235-
<form method="POST" action="/verify">
236-
@csrf
237-
<div id="contact_us_id"></div>
238-
<input type="submit" value="submit">
239-
<div>
240-
<small>
241-
This site is protected by reCAPTCHA and the Google
242-
<a href="https://policies.google.com/privacy">Privacy Policy</a> and
243-
<a href="https://policies.google.com/terms">Terms of Service</a> apply.
244-
</small>
245-
</div>
246-
</form>
247-
248-
{!! GoogleReCaptchaV3::render([
249-
'contact_us_id'=>'contact_us'
250-
]) !!}
251-
252-
```
253-
254-
The backend request will receive a value for 'g-recaptcha-response', please take a look at Sample Use Case and Facade usage sections.
255-
256-
### Badge Display
257-
258-
If your settings were not reflected, please run php artisan config:cache to clear cache.
259-
260-
Inline
261-
262-
1. Go to config file, and set
263-
``` PHP
264-
[
265-
...
266-
'inline' => true
267-
...
268-
]
269-
```
270-
2. Badge will be displayed as inline format within the form.
271-
272-
273-
Invisible
274-
275-
1. Set inline as true as well
276-
2. Modify your div with style display:none
277-
3. Refer to Google official site: https://developers.google.com/recaptcha/docs/faq
278-
, you need to include the following text:
279-
``` HTML
280-
This site is protected by reCAPTCHA and the Google
281-
<a href="https://policies.google.com/privacy">Privacy Policy</a> and
282-
<a href="https://policies.google.com/terms">Terms of Service</a> apply.
283-
```
284-
285-
Corner
286-
287-
1. Set inline as false
288-
2. Your badge will be shown in the bottom right side.
289-
290-
Custom
291-
292-
1. Set inline as true
293-
2. Do Styling/CSS on its div element
294-
295-
296-
### Blade Use Case
297-
298234
Register your action in config, also enable score and set up your own site key and secret key:
299235
``` php
300236
'setting' => [
@@ -349,9 +285,51 @@ Create your form in index.blade.php:
349285
{!! GoogleReCaptchaV3::render(['contact_us_id'=>'contact_us', 'signup_id'=>'signup']) !!}
350286
```
351287

288+
The backend request will receive a value for 'g-recaptcha-response'.
289+
352290
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.
353291

354-
## Vue Usage <a name="vue-usage" />
292+
### Badge Display
293+
294+
If your settings were not reflected, please run php artisan config:cache to clear cache.
295+
296+
Inline
297+
298+
1. Go to config file, and set
299+
``` PHP
300+
[
301+
...
302+
'inline' => true
303+
...
304+
]
305+
```
306+
2. Badge will be displayed as inline format within the form.
307+
308+
309+
Invisible
310+
311+
1. Set inline as true as well
312+
2. Modify your div with style display:none
313+
3. Refer to Google official site: https://developers.google.com/recaptcha/docs/faq
314+
, you need to include the following text:
315+
``` HTML
316+
This site is protected by reCAPTCHA and the Google
317+
<a href="https://policies.google.com/privacy">Privacy Policy</a> and
318+
<a href="https://policies.google.com/terms">Terms of Service</a> apply.
319+
```
320+
321+
Corner
322+
323+
1. Set inline as false
324+
2. Your badge will be shown in the bottom right side.
325+
326+
Custom
327+
328+
1. Set inline as true
329+
2. Do Styling/CSS on its div element
330+
331+
332+
## Vue Usage (Pacakge version >= 2.2.0) <a name="vue-usage" />
355333

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

@@ -367,7 +345,7 @@ The file will be created under js/components/googlerecaptchav3/GoogleReCaptchaV3
367345

368346
#### A BIG thanks to [@Fluxlicious](https://github.com/Fluxlicious) who improved the vue component.
369347

370-
The Blade way is no longer useful if you use Vue, so we need to manage to assign site key by ourselves. The component supports props below:
348+
The Blade way is no longer useful if you use Vue. We need to manage to assign site key by ourselves. The component supports props below:
371349

372350
Supported: siteKey, id, inline and action, check the original file to see the details.
373351

contributing.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ Contributions are accepted via Pull Requests on [Github](https://github.com/ryan
88

99

1010
Contributors:
11-
@xalunda PR: https://github.com/RyanDaDeng/laravel-google-recaptcha-v3/pull/16
11+
12+
* [@xalunda](https://github.com/xalunda)
13+
- https://github.com/RyanDaDeng/laravel-google-recaptcha-v3/pull/16
14+
15+
* [@Fluxlicious](https://github.com/Fluxlicious)
16+
- https://github.com/RyanDaDeng/laravel-google-recaptcha-v3/pull/21

0 commit comments

Comments
 (0)