@@ -47,8 +47,11 @@ |
||
| 47 | 47 | protected function registerReCaptchaBuilder() |
| 48 | 48 | { |
| 49 | 49 | $this->app->singleton('recaptcha', function ($app) { |
| 50 | - if(config('recaptcha.version') == 'v2') return new ReCaptchaBuilderV2(config('recaptcha.api_site_key'), config('recaptcha.api_secret_key'), config('recaptcha.version')); |
|
| 51 | - else return new ReCaptchaBuilderInvisible(config('recaptcha.api_site_key'), config('recaptcha.api_secret_key'), config('recaptcha.version')); |
|
| 50 | + if(config('recaptcha.version') == 'v2') { |
|
| 51 | + return new ReCaptchaBuilderV2(config('recaptcha.api_site_key'), config('recaptcha.api_secret_key'), config('recaptcha.version')); |
|
| 52 | + } else { |
|
| 53 | + return new ReCaptchaBuilderInvisible(config('recaptcha.api_site_key'), config('recaptcha.api_secret_key'), config('recaptcha.version')); |
|
| 54 | + } |
|
| 52 | 55 | }); |
| 53 | 56 | } |
| 54 | 57 | |
@@ -63,10 +63,14 @@ |
||
| 63 | 63 | */ |
| 64 | 64 | public function htmlScriptTagJsApi($formId = '') |
| 65 | 65 | { |
| 66 | - if($this->skip_by_ip) return ''; |
|
| 66 | + if($this->skip_by_ip) { |
|
| 67 | + return ''; |
|
| 68 | + } |
|
| 67 | 69 | $html = "<script src='https://www.google.com/recaptcha/api.js' async defer></script>"; |
| 68 | 70 | if($this->version != 'v2'){ |
| 69 | - if(!$formId) throw new Exception("formId required", 1); |
|
| 71 | + if(!$formId) { |
|
| 72 | + throw new Exception("formId required", 1); |
|
| 73 | + } |
|
| 70 | 74 | $html.= '<script> |
| 71 | 75 | function biscolabLaravelReCaptcha(token) { |
| 72 | 76 | document.getElementById("'.$formId.'").submit(); |