first commit

This commit is contained in:
franknstayn
2021-07-03 18:39:08 +08:00
commit 5483c9517d
1555 changed files with 417773 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php namespace App\Traits;
use Input;
use ReCaptcha\ReCaptcha;
trait CaptchaTrait {
public function captchaCheck()
{
$response = Input::get('g-recaptcha-response');
$remoteip = $_SERVER['REMOTE_ADDR'];
$secret = env('CAPTCHA_SECRET_KEY');
$recaptcha = new ReCaptcha($secret);
$resp = $recaptcha->verify($response, $remoteip);
if ($resp->isSuccess()) {
return 1;
} else {
return 0;
}
}
}