Skip to content

Commit f1c61ea

Browse files
committed
first commit
0 parents  commit f1c61ea

25 files changed

+1721
-0
lines changed

.styleci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
preset: laravel

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
dist: trusty
2+
3+
language: php
4+
5+
php:
6+
- 7.1
7+
8+
matrix:
9+
fast_finish: true
10+
11+
install:
12+
- travis_retry composer self-update
13+
- travis_retry composer install --prefer-source --no-interaction --dev
14+
15+
after_success:
16+
- travis_retry php vendor/bin/php-coveralls -v
17+
18+
script:
19+
- mkdir -p build/logs
20+
- php vendor/bin/phpunit -c phpunit.xml.dist
21+
22+
cache:
23+
directories:
24+
- "$HOME/.composer/cache/files"

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
All notable changes to `LaravelGoogleReCaptchaV2` will be documented in this file.
4+
5+
## Version 1.0
6+
7+
### Added
8+
- Everything

composer.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "timehunter/laravel-google-recaptcha-v2",
3+
"description": "Laravel Package for reCAPTCHA v2",
4+
"license": "MIT",
5+
"authors": [
6+
{
7+
"name": "Ryan Deng",
8+
"email": "ryandadeng@gmail.com",
9+
"homepage": "https://ryandeng.com"
10+
}
11+
],
12+
"homepage": "https://github.com/RyanDaDeng/laravel-google-recaptcha-v2",
13+
"keywords": [
14+
"laravel recaptcha",
15+
"googlerecaptcha",
16+
"google recaptcha",
17+
"google recaptcha v2",
18+
"recaptcha v2",
19+
"laravel google recaptcha v2",
20+
"laravel google recaptcha",
21+
"recaptcha",
22+
"recaptcha v2 laravel",
23+
"laravel recaptcha v2",
24+
"laravel"
25+
],
26+
"require": {
27+
"php": ">=5.5",
28+
"guzzlehttp/guzzle": "^6.2"
29+
},
30+
"require-dev": {
31+
"phpunit/phpunit": "~7.0",
32+
"orchestra/testbench": "~3.0",
33+
"php-coveralls/php-coveralls": "^2.1"
34+
},
35+
"autoload": {
36+
"psr-4": {
37+
"TimeHunter\\LaravelGoogleReCaptchaV2\\": "src/"
38+
}
39+
},
40+
"autoload-dev": {
41+
"psr-4": {
42+
"TimeHunter\\LaravelGoogleReCaptchaV2\\Tests\\": "tests"
43+
}
44+
},
45+
"extra": {
46+
"laravel": {
47+
"providers": [
48+
"TimeHunter\\LaravelGoogleReCaptchaV2\\Providers\\GoogleReCaptchaV2ServiceProvider"
49+
],
50+
"aliases": {
51+
"GoogleReCaptchaV2": "TimeHunter\\LaravelGoogleReCaptchaV2\\Facades\\GoogleReCaptchaV2"
52+
}
53+
}
54+
}
55+
}

config/googlerecaptchav2.php

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Default Request Method
8+
|--------------------------------------------------------------------------
9+
|
10+
| If not provided, will use curl as default.
11+
| Supported: "guzzle", "curl", if you want to use your own request method,
12+
| please read document.
13+
|
14+
*/
15+
'request_method' => 'curl',
16+
17+
/*
18+
|--------------------------------------------------------------------------
19+
| reCAPTCHA Template file
20+
|--------------------------------------------------------------------------
21+
| Type: string
22+
| Default: GoogleReCaptchaV2::googlerecaptchav2.template
23+
| If you want to customise your own template, you can change it.
24+
|
25+
*/
26+
'template'=>'GoogleReCaptchaV2::googlerecaptchav2.template',
27+
28+
/*
29+
|--------------------------------------------------------------------------
30+
| Enable/Disable Service
31+
|--------------------------------------------------------------------------
32+
| Type: bool
33+
|
34+
| This option is used to disable/enable the service
35+
|
36+
| Supported: true, false
37+
|
38+
*/
39+
'is_service_enabled' => true,
40+
/*
41+
|--------------------------------------------------------------------------
42+
| Host Name
43+
|--------------------------------------------------------------------------
44+
| Type: string
45+
| Default will be empty, assign value only if you want domain check with Google response
46+
| Google reCAPTCHA host name, https://www.google.com/recaptcha/admin
47+
|
48+
*/
49+
'host_name' => '',
50+
/*
51+
|--------------------------------------------------------------------------
52+
| Secret Key
53+
|--------------------------------------------------------------------------
54+
| Type: string
55+
| Google reCAPTCHA credentials, https://www.google.com/recaptcha/admin
56+
|
57+
*/
58+
'secret_key' => '',
59+
/*
60+
|--------------------------------------------------------------------------
61+
| Site Key
62+
|--------------------------------------------------------------------------
63+
| Type: string
64+
| Google reCAPTCHA credentials, https://www.google.com/recaptcha/admin
65+
|
66+
*/
67+
'site_key' => '',
68+
69+
/*
70+
|--------------------------------------------------------------------------
71+
| Badge Style
72+
|--------------------------------------------------------------------------
73+
| Type: string
74+
| Supported: bottomright,bottomleft,inline
75+
| - if your size is invisible, you can use bottomright or bottomleft to adjust your badge location
76+
|
77+
*/
78+
'badge' => 'inline',
79+
80+
/*
81+
|--------------------------------------------------------------------------
82+
| Size
83+
|--------------------------------------------------------------------------
84+
| Type: string
85+
| supported: invisible
86+
| if your reCAPTCHA supports invisible, you can put 'invisible', otherwise leave it as empty string
87+
|
88+
*/
89+
'size' => '',
90+
91+
/*
92+
|--------------------------------------------------------------------------
93+
| Theme Style
94+
|--------------------------------------------------------------------------
95+
| Type: string
96+
| supported: dark, light
97+
|
98+
*/
99+
'theme' => 'light',
100+
/*
101+
|--------------------------------------------------------------------------
102+
| Options
103+
|--------------------------------------------------------------------------
104+
| Custom option field for your request setting, which will be used for RequestClientInterface
105+
|
106+
*/
107+
'options' => [
108+
109+
],
110+
/*
111+
|--------------------------------------------------------------------------
112+
| Site Verify Url
113+
|--------------------------------------------------------------------------
114+
| Type: string
115+
| Google reCAPTCHA API
116+
*/
117+
'site_verify_url' => 'https://www.google.com/recaptcha/api/siteverify',
118+
119+
/*
120+
|--------------------------------------------------------------------------
121+
| Language
122+
|--------------------------------------------------------------------------
123+
| Type: string
124+
| https://developers.google.com/recaptcha/docs/language
125+
*/
126+
'language' => 'en',
127+
];

contributing.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Contributing
2+
3+
Contributions are welcome and will be fully credited.
4+
5+
Contributions are accepted via Pull Requests on [Github](https://github.com/timehunter/laravelgooglerecaptchav2).
6+
7+
# Things you could do
8+
If you want to contribute but do not know where to start, this list provides some starting points.
9+
- Add license text
10+
- Remove rewriteRules.php
11+
- Set up TravisCI, StyleCI, ScrutinizerCI
12+
- Write a comprehensive ReadMe
13+
14+
## Pull Requests
15+
16+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
17+
18+
- **Document any change in behaviour** - Make sure the `readme.md` and any other relevant documentation are kept up-to-date.
19+
20+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
21+
22+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
23+
24+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
25+
26+
27+
**Happy coding**!

license.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# The license
2+
3+
Copyright (c) Ryan Deng <ryandadeng@gmail.com>
4+
5+
...Add your license text here...

phpunit.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Package">
14+
<directory suffix=".php">./tests/</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory>src/</directory>
20+
</whitelist>
21+
</filter>
22+
</phpunit>

phpunit.xml.dist

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Google reCAPTCHA v2 Test Suite">
14+
<directory suffix=".php">./tests/</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<file>src/GoogleReCaptchaV2.php</file>
20+
<directory>src/Core/</directory>
21+
<directory>src/Services/</directory>
22+
</whitelist>
23+
</filter>
24+
<logging>
25+
<log type="coverage-clover" target="build/logs/clover.xml"/>
26+
</logging>
27+
</phpunit>

0 commit comments

Comments
 (0)