Skip to content

Commit

Permalink
Merge pull request #49 from ARCANEDEV/develop
Browse files Browse the repository at this point in the history
Extracting Laravel 5.4 Support
  • Loading branch information
arcanedev-maroc authored Mar 13, 2017
2 parents 1c3145f + 6013f0a commit e438937
Show file tree
Hide file tree
Showing 17 changed files with 153 additions and 148 deletions.
4 changes: 2 additions & 2 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ checks:

tools:
external_code_coverage:
timeout: 1200
runs: 12
timeout: 600
runs: 3
php_code_sniffer:
enabled: true
config:
Expand Down
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ matrix:
- php: nightly

env:
- TESTBENCH_VERSION=3.0.*
- TESTBENCH_VERSION=3.1.*
- TESTBENCH_VERSION=3.2.*
- TESTBENCH_VERSION=3.3.*
- TESTBENCH_VERSION=3.4.*

before_script:
- travis_retry composer self-update
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ reCAPTCHA comes in the form of a widget that you can easily add to your blog, fo
* Laravel `4.2 | 5.0 | 5.1 | 5.2 | 5.3 | 5.4` are supported.
* PSR-7 Support (ServerRequest verification).
* Made with :heart: & :coffee:.

## Table of contents

1. [Requirements](_docs/1-Requirements.md)
2. [Version Compatibility](_docs/2-Version-Compatibility.md)
3. [Installation and Setup](_docs/3-Installation-and-Setup.md)
4. [Configuration](_docs/4-Configuration.md)
5. [Usage](_docs/5-Usage.md)
6. [Extras](_docs/6-Extras.md)
7. [FAQ](_docs/7-FAQ.md)
1. [Installation and Setup](_docs/1-Installation-and-Setup.md)
2. [Configuration](_docs/2-Configuration.md)
3. [Usage](_docs/3-Usage.md)
4. [Extras](_docs/4-Extras.md)
5. [FAQ](_docs/5-FAQ.md)

## Contribution

Expand Down
12 changes: 5 additions & 7 deletions _docs/0-Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ reCAPTCHA comes in the form of a widget that you can easily add to your blog, fo

## Table of contents

1. [Requirements](1-Requirements.md)
2. [Version Compatibility](2-Version-Compatibility.md)
3. [Installation and Setup](3-Installation-and-Setup.md)
4. [Configuration](4-Configuration.md)
5. [Usage](5-Usage.md)
6. [Extras](6-Extras.md)
7. [FAQ](7-FAQ.md)
1. [Installation and Setup](1-Installation-and-Setup.md)
2. [Configuration](2-Configuration.md)
3. [Usage](3-Usage.md)
4. [Extras](4-Extras.md)
5. [FAQ](5-FAQ.md)
90 changes: 90 additions & 0 deletions _docs/1-Installation-and-Setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# 1. Installation

## Table of contents

1. [Installation and Setup](1-Installation-and-Setup.md)
2. [Configuration](2-Configuration.md)
3. [Usage](3-Usage.md)
4. [Extras](4-Extras.md)
5. [FAQ](5-FAQ.md)

## Requirements

- PHP >= 5.6
- ext-curl: *
- ext-json: *

To use reCAPTCHA, you need to have a `site key` and a `secret key`. [Click here](https://www.google.com/recaptcha/admin) to setup a domain and get your keys.

The `site key` is using for the widget and the `secret key` is used to validate the response we get from Google.

For more details, check the [official documentation](https://developers.google.com/recaptcha/).

## Version Compatibility

| noCaptcha | Laravel |
|:----------------------------------|:--------------------------------------------------------------------------------------------------------------------|
| ![noCaptcha v1.x][no_captcha_1_x] | ![Laravel v4.2][laravel_4_2] |
| ![noCaptcha v3.x][no_captcha_3_x] | ![Laravel v5.0][laravel_5_0] ![Laravel v5.1][laravel_5_1] ![Laravel v5.2][laravel_5_2] ![Laravel v5.3][laravel_5_3] |
| ![noCaptcha v4.x][no_captcha_4_x] | ![Laravel v5.4][laravel_5_4] |

> **Note :** This is a framework-agnostic package, so you can use any version of this package in your PHP project.
[laravel_4_2]: https://img.shields.io/badge/v4.2-supported-brightgreen.svg?style=flat-square "Laravel v4.2"
[laravel_5_0]: https://img.shields.io/badge/v5.0-supported-brightgreen.svg?style=flat-square "Laravel v5.0"
[laravel_5_1]: https://img.shields.io/badge/v5.1-supported-brightgreen.svg?style=flat-square "Laravel v5.1"
[laravel_5_2]: https://img.shields.io/badge/v5.2-supported-brightgreen.svg?style=flat-square "Laravel v5.2"
[laravel_5_3]: https://img.shields.io/badge/v5.3-supported-brightgreen.svg?style=flat-square "Laravel v5.3"
[laravel_5_4]: https://img.shields.io/badge/v5.4-supported-brightgreen.svg?style=flat-square "Laravel v5.4"

[no_captcha_1_x]: https://img.shields.io/badge/version-1.*-blue.svg?style=flat-square "noCaptcha v1.*"
[no_captcha_3_x]: https://img.shields.io/badge/version-3.*-blue.svg?style=flat-square "noCaptcha v3.*"
[no_captcha_4_x]: https://img.shields.io/badge/version-4.*-blue.svg?style=flat-square "noCaptcha v4.*"

## Composer

You can install this package via [Composer](http://getcomposer.org/) by running this command `composer require arcanedev/no-captcha`.

> For Laravel users, please check the [Version Compatibility](2-Version-Compatibility.md) section.
## Laravel

### Setup

Once the package is installed, you can register the service provider in `config/app.php` in the `providers` array:

```php
'providers' => [
...
Arcanedev\NoCaptcha\NoCaptchaServiceProvider::class,
],
```

And the facade in the `aliases` array:

```php
'aliases' => [
...
'Captcha' => Arcanedev\NoCaptcha\Facades\NoCaptcha::class,
],
```

> For Laravel 4.2 (PHP 5.4), the config file is located in `app/config/app.php`
In the `providers` array:

```php
'providers' => [
...
'Arcanedev\NoCaptcha\Laravel\ServiceProvider',
],
```

And the facade in the `aliases` array:

```php
'aliases' => [
...
'Captcha' => 'Arcanedev\NoCaptcha\Laravel\Facade',
],
```
11 changes: 0 additions & 11 deletions _docs/1-Requirements.md

This file was deleted.

10 changes: 9 additions & 1 deletion _docs/4-Configuration.md → _docs/2-Configuration.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# 4. Configuration
# 2. Configuration

## Table of contents

1. [Installation and Setup](1-Installation-and-Setup.md)
2. [Configuration](2-Configuration.md)
3. [Usage](3-Usage.md)
4. [Extras](4-Extras.md)
5. [FAQ](5-FAQ.md)

There is not really a need to publish the configuration file. Both the `secret` and `sitekey` should be set in your environment file so it won't be available in your versioning system.

Expand Down
18 changes: 0 additions & 18 deletions _docs/2-Version-Compatibility.md

This file was deleted.

61 changes: 0 additions & 61 deletions _docs/3-Installation-and-Setup.md

This file was deleted.

11 changes: 8 additions & 3 deletions _docs/5-Usage.md → _docs/3-Usage.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# 5. Usage
# 3. Usage

## Table of contents

* [Hard Coded (Any PHP Project)](#hard-coded-any-php-project)
* [Laravel](#laravel)
1. [Installation and Setup](1-Installation-and-Setup.md)
2. [Configuration](2-Configuration.md)
3. [Usage](3-Usage.md)
* [Hard Coded (Any PHP Project)](#hard-coded-any-php-project)
* [Laravel](#laravel)
4. [Extras](4-Extras.md)
5. [FAQ](5-FAQ.md)

### Hard Coded (Any PHP Project)

Expand Down
10 changes: 9 additions & 1 deletion _docs/6-Extras.md → _docs/4-Extras.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# 6. Extras
# 4. Extras

## Table of contents

1. [Installation and Setup](1-Installation-and-Setup.md)
2. [Configuration](2-Configuration.md)
3. [Usage](3-Usage.md)
4. [Extras](4-Extras.md)
5. [FAQ](5-FAQ.md)

## g-recaptcha tag attributes

Expand Down
10 changes: 9 additions & 1 deletion _docs/7-FAQ.md → _docs/5-FAQ.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# 7. FAQ
# 5. FAQ

## Table of contents

1. [Installation and Setup](1-Installation-and-Setup.md)
2. [Configuration](2-Configuration.md)
3. [Usage](3-Usage.md)
4. [Extras](4-Extras.md)
5. [FAQ](5-FAQ.md)

* **Q:** I have a question, what to do ?
* **A:** Make sure to check our [GitHub issues][github_questions] for answers.
Expand Down
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
"type": "library",
"license": "MIT",
"require": {
"php": ">=5.6.4",
"ext-curl": "*",
"ext-json": "*",
"arcanedev/support": "~3.20",
"psr/http-message": "~1.0"
"php": ">=5.6.4",
"ext-curl": "*",
"ext-json": "*",
"arcanedev/support": "~4.0",
"psr/http-message": "~1.0"
},
"require-dev": {
"arcanedev/laravel-html": "~5.0",
"phpunit/phpcov": "~3.0",
"phpunit/phpunit": "~5.0"
"phpunit/phpunit": "~5.0",
"orchestra/testbench": "~3.0"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 2 additions & 4 deletions src/Facades/NoCaptcha.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace Arcanedev\NoCaptcha\Facades;

use Arcanedev\NoCaptcha\Contracts\NoCaptcha as NoCaptchaContract;
use Illuminate\Support\Facades\Facade;

/**
Expand All @@ -15,8 +16,5 @@ class NoCaptcha extends Facade
*
* @return string
*/
protected static function getFacadeAccessor()
{
return \Arcanedev\NoCaptcha\Contracts\NoCaptcha::class;
}
protected static function getFacadeAccessor() { return NoCaptchaContract::class; }
}
Loading

0 comments on commit e438937

Please sign in to comment.