Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public static function validate($input) |
||
29 | { |
||
30 | // Guzzle |
||
31 | $http = new Client(); |
||
32 | |||
33 | $response = $http->request('POST', 'https://www.google.com/recaptcha/api/siteverify', [ |
||
34 | 'form_params' => [ |
||
35 | 'secret' => config('recaptcha.secret'), |
||
36 | 'response' => $input, |
||
37 | 'remoteip' => request()->header('REMOTE_ADDR'), |
||
38 | ] |
||
39 | ]); |
||
40 | |||
41 | return json_decode($response->getBody()->getContents(), true); |
||
42 | } |
||
43 | } |
||
44 |