Initial Commit

This commit is contained in:
Frank John Begornia
2019-03-06 20:32:31 +08:00
commit 562f03488a
2123 changed files with 780991 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;
}
}
}