| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php namespace jlourenco\support\Traits; |
||
| 9 | public function captchaCheck() |
||
| 10 | {
|
||
| 11 | $response = Input::get('g-recaptcha-response');
|
||
| 12 | $remoteip = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_SANITIZE_STRING); //$_SERVER['REMOTE_ADDR']; |
||
| 13 | $secret = config('jlourenco.support.RE_CAP_SECRET');
|
||
| 14 | |||
| 15 | $recaptcha = new ReCaptcha($secret); |
||
| 16 | $resp = $recaptcha->verify($response, $remoteip); |
||
| 17 | |||
| 18 | if ($resp->isSuccess()) |
||
| 19 | return true; |
||
| 20 | else |
||
| 21 | return false; |
||
| 22 | } |
||
| 23 | |||
| 24 | } |