Skip to content

Commit

Permalink
update readme and style
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc committed Aug 11, 2016
1 parent 4feea17 commit d48f93e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
18 changes: 14 additions & 4 deletions README.md
Expand Up @@ -37,13 +37,13 @@ $ composer update
Next, You should need to register the service provider. Open up `config/app.php` and add following into the `providers` key.

```php
Germey\Geetest\GeetestServiceProvider::class
Germey\Geetest\GeetestServiceProvider::class
```

And you can register the Geetest Facade in the `aliases` of `config/app.php` if you want.

```php
'Geetest' => Germey\Geetest\Geetest::class,
'Geetest' => Germey\Geetest\Geetest::class
```

## Configuration
Expand Down Expand Up @@ -71,7 +71,17 @@ GEETEST_ID=0f1097bef7xxxxxx9afdeced970c63e4
GEETEST_KEY=c070f0628xxxxxxe68e138b55c56fb3b
```

Next, You need to configure an Ajax validation url. Default is `/auth/geetest`. So you can use Trait `Germey\Geetest\CaptchaGeetest` in AuthController which routing '/auth'.
Next, You need to configure an Ajax validation url route. Default is `/auth/geetest`.

For example, add this to `routes.php`

```php
Route::get('auth/geetest','Auth\AuthController@getGeetest');
```

Or you can use `Route::controller()` method to achieve this route.

Next, you can use Trait `Germey\Geetest\CaptchaGeetest` in AuthController which routing '/auth'.

```php
use Germey\Geetest\CaptchaGeetest;
Expand Down Expand Up @@ -146,7 +156,7 @@ class BaseController extends Controller
], [
'geetest' => Config::get('geetest.server_fail_alert')
]);
if ($request) {
if ($result) {
return 'success';
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/views/geetest.blade.php
Expand Up @@ -40,4 +40,9 @@
(function() {
geetest('{{ $geetest_url?$geetest_url:Config::get('geetest.geetest_url', '/auth/geetest') }}');
})();
</script>
</script>
<style>
.hide {
display: none;
}
</style>

0 comments on commit d48f93e

Please sign in to comment.