Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanDaDeng committed Dec 28, 2018
0 parents commit f1c61ea
Show file tree
Hide file tree
Showing 25 changed files with 1,721 additions and 0 deletions.
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
preset: laravel
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
dist: trusty

language: php

php:
- 7.1

matrix:
fast_finish: true

install:
- travis_retry composer self-update
- travis_retry composer install --prefer-source --no-interaction --dev

after_success:
- travis_retry php vendor/bin/php-coveralls -v

script:
- mkdir -p build/logs
- php vendor/bin/phpunit -c phpunit.xml.dist

cache:
directories:
- "$HOME/.composer/cache/files"
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

All notable changes to `LaravelGoogleReCaptchaV2` will be documented in this file.

## Version 1.0

### Added
- Everything
55 changes: 55 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "timehunter/laravel-google-recaptcha-v2",
"description": "Laravel Package for reCAPTCHA v2",
"license": "MIT",
"authors": [
{
"name": "Ryan Deng",
"email": "[email protected]",
"homepage": "https://ryandeng.com"
}
],
"homepage": "https://github.com/RyanDaDeng/laravel-google-recaptcha-v2",
"keywords": [
"laravel recaptcha",
"googlerecaptcha",
"google recaptcha",
"google recaptcha v2",
"recaptcha v2",
"laravel google recaptcha v2",
"laravel google recaptcha",
"recaptcha",
"recaptcha v2 laravel",
"laravel recaptcha v2",
"laravel"
],
"require": {
"php": ">=5.5",
"guzzlehttp/guzzle": "^6.2"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
"orchestra/testbench": "~3.0",
"php-coveralls/php-coveralls": "^2.1"
},
"autoload": {
"psr-4": {
"TimeHunter\\LaravelGoogleReCaptchaV2\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"TimeHunter\\LaravelGoogleReCaptchaV2\\Tests\\": "tests"
}
},
"extra": {
"laravel": {
"providers": [
"TimeHunter\\LaravelGoogleReCaptchaV2\\Providers\\GoogleReCaptchaV2ServiceProvider"
],
"aliases": {
"GoogleReCaptchaV2": "TimeHunter\\LaravelGoogleReCaptchaV2\\Facades\\GoogleReCaptchaV2"
}
}
}
}
127 changes: 127 additions & 0 deletions config/googlerecaptchav2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Default Request Method
|--------------------------------------------------------------------------
|
| If not provided, will use curl as default.
| Supported: "guzzle", "curl", if you want to use your own request method,
| please read document.
|
*/
'request_method' => 'curl',

/*
|--------------------------------------------------------------------------
| reCAPTCHA Template file
|--------------------------------------------------------------------------
| Type: string
| Default: GoogleReCaptchaV2::googlerecaptchav2.template
| If you want to customise your own template, you can change it.
|
*/
'template'=>'GoogleReCaptchaV2::googlerecaptchav2.template',

/*
|--------------------------------------------------------------------------
| Enable/Disable Service
|--------------------------------------------------------------------------
| Type: bool
|
| This option is used to disable/enable the service
|
| Supported: true, false
|
*/
'is_service_enabled' => true,
/*
|--------------------------------------------------------------------------
| Host Name
|--------------------------------------------------------------------------
| Type: string
| Default will be empty, assign value only if you want domain check with Google response
| Google reCAPTCHA host name, https://www.google.com/recaptcha/admin
|
*/
'host_name' => '',
/*
|--------------------------------------------------------------------------
| Secret Key
|--------------------------------------------------------------------------
| Type: string
| Google reCAPTCHA credentials, https://www.google.com/recaptcha/admin
|
*/
'secret_key' => '',
/*
|--------------------------------------------------------------------------
| Site Key
|--------------------------------------------------------------------------
| Type: string
| Google reCAPTCHA credentials, https://www.google.com/recaptcha/admin
|
*/
'site_key' => '',

/*
|--------------------------------------------------------------------------
| Badge Style
|--------------------------------------------------------------------------
| Type: string
| Supported: bottomright,bottomleft,inline
| - if your size is invisible, you can use bottomright or bottomleft to adjust your badge location
|
*/
'badge' => 'inline',

/*
|--------------------------------------------------------------------------
| Size
|--------------------------------------------------------------------------
| Type: string
| supported: invisible
| if your reCAPTCHA supports invisible, you can put 'invisible', otherwise leave it as empty string
|
*/
'size' => '',

/*
|--------------------------------------------------------------------------
| Theme Style
|--------------------------------------------------------------------------
| Type: string
| supported: dark, light
|
*/
'theme' => 'light',
/*
|--------------------------------------------------------------------------
| Options
|--------------------------------------------------------------------------
| Custom option field for your request setting, which will be used for RequestClientInterface
|
*/
'options' => [

],
/*
|--------------------------------------------------------------------------
| Site Verify Url
|--------------------------------------------------------------------------
| Type: string
| Google reCAPTCHA API
*/
'site_verify_url' => 'https://www.google.com/recaptcha/api/siteverify',

/*
|--------------------------------------------------------------------------
| Language
|--------------------------------------------------------------------------
| Type: string
| https://developers.google.com/recaptcha/docs/language
*/
'language' => 'en',
];
27 changes: 27 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing

Contributions are welcome and will be fully credited.

Contributions are accepted via Pull Requests on [Github](https://github.com/timehunter/laravelgooglerecaptchav2).

# Things you could do
If you want to contribute but do not know where to start, this list provides some starting points.
- Add license text
- Remove rewriteRules.php
- Set up TravisCI, StyleCI, ScrutinizerCI
- Write a comprehensive ReadMe

## Pull Requests

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `readme.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **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.


**Happy coding**!
5 changes: 5 additions & 0 deletions license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# The license

Copyright (c) Ryan Deng <[email protected]>

...Add your license text here...
22 changes: 22 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Package">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>src/</directory>
</whitelist>
</filter>
</phpunit>
27 changes: 27 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Google reCAPTCHA v2 Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<file>src/GoogleReCaptchaV2.php</file>
<directory>src/Core/</directory>
<directory>src/Services/</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
Loading

0 comments on commit f1c61ea

Please sign in to comment.