����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.170 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/self/root/home/builderbox/./www/common/Validation/ |
Upload File : |
<?php namespace Common\Validation;
use Common\Core\BaseController;
use Common\Settings\Settings;
use GuzzleHttp\Client;
use Illuminate\Http\Request;
class RecaptchaController extends BaseController
{
/**
* @var Request
*/
private $request;
/**
* @var Client
*/
private $http;
/**
* @var Settings
*/
private $settings;
/**
* @param Request $request
* @param Client $http
* @param Settings $settings
*/
public function __construct(Request $request, Client $http, Settings $settings)
{
$this->request = $request;
$this->http = $http;
$this->settings = $settings;
}
public function verify()
{
$this->validate($this->request, [
'token' => 'required|string'
]);
$response = $this->http->post('https://www.google.com/recaptcha/api/siteverify', [
'form_params' => [
'response' => $this->request->get('token'),
'secret' => $this->settings->get('recaptcha.secret_key'),
'remoteip' => $this->request->getClientIp()
]
]);
$response = json_decode($response->getBody()->getContents(), true);
$success = $response['success'] && $response['score'] > 0.1;
return $this->success(['success' => $success]);
}
}