@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function htmlFormSnippet(): string { |
| 36 | 36 | |
| 37 | - return ($this->version == 'v2') ? '<div class="g-recaptcha" data-sitekey="' . $this->api_site_key . '"></div>' : ''; |
|
| 37 | + return ($this->version == 'v2') ? '<div class="g-recaptcha" data-sitekey="'.$this->api_site_key.'"></div>' : ''; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | } |
| 41 | 41 | \ No newline at end of file |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function htmlFormButton($buttonInnerHTML = 'Submit'): string { |
| 39 | 39 | |
| 40 | - return ($this->version == 'invisible') ? '<button class="g-recaptcha" data-sitekey="' . $this->api_site_key . '" data-callback="biscolabLaravelReCaptcha">' . $buttonInnerHTML . '</button>' : ''; |
|
| 40 | + return ($this->version == 'invisible') ? '<button class="g-recaptcha" data-sitekey="'.$this->api_site_key.'" data-callback="biscolabLaravelReCaptcha">'.$buttonInnerHTML.'</button>' : ''; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | } |
| 44 | 44 | \ No newline at end of file |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | public function getIpWhitelist() { |
| 117 | 117 | $whitelist = config('recaptcha.skip_ip', []); |
| 118 | 118 | |
| 119 | - if(!is_array($whitelist)) { |
|
| 119 | + if (!is_array($whitelist)) { |
|
| 120 | 120 | $whitelist = explode(',', $whitelist); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | $html .= '<script> |
| 165 | 165 | function biscolabLaravelReCaptcha(token) { |
| 166 | - document.getElementById("' . $formId . '").submit(); |
|
| 166 | + document.getElementById("' . $formId.'").submit(); |
|
| 167 | 167 | } |
| 168 | 168 | </script>'; |
| 169 | 169 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $js_callback_catch = ($js_callback_catch) ? "{$js_callback_catch}(err)" : ''; |
| 188 | 188 | |
| 189 | 189 | $validate_function = " |
| 190 | - fetch('/" . config('recaptcha.default_validation_route', 'biscolab-recaptcha/validate') . "?" . config('recaptcha.default_token_parameter_name', 'token') . "=' + token, { |
|
| 190 | + fetch('/" . config('recaptcha.default_validation_route', 'biscolab-recaptcha/validate')."?".config('recaptcha.default_token_parameter_name', 'token')."=' + token, { |
|
| 191 | 191 | headers: { |
| 192 | 192 | \"X-Requested-With\": \"XMLHttpRequest\", |
| 193 | 193 | \"X-CSRF-TOKEN\": csrfToken.content |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | 'response' => $response, |
| 253 | 253 | ]); |
| 254 | 254 | |
| 255 | - $url = $this->api_url . '?' . $params; |
|
| 255 | + $url = $this->api_url.'?'.$params; |
|
| 256 | 256 | |
| 257 | 257 | if (function_exists('curl_version')) { |
| 258 | 258 | $curl = curl_init($url); |
@@ -193,8 +193,7 @@ discard block |
||
| 193 | 193 | document.getElementById("' . $formId . '").submit(); |
| 194 | 194 | } |
| 195 | 195 | </script>'; |
| 196 | - } |
|
| 197 | - elseif ($this->version == 'v3') { |
|
| 196 | + } elseif ($this->version == 'v3') { |
|
| 198 | 197 | |
| 199 | 198 | $action = array_get($configuration, 'action', 'homepage'); |
| 200 | 199 | |
@@ -204,8 +203,7 @@ discard block |
||
| 204 | 203 | if ($js_custom_validation) { |
| 205 | 204 | |
| 206 | 205 | $validate_function = ($js_custom_validation) ? "{$js_custom_validation}(token);" : ''; |
| 207 | - } |
|
| 208 | - else { |
|
| 206 | + } else { |
|
| 209 | 207 | |
| 210 | 208 | $js_then_callback = array_get($configuration, 'callback_then', ''); |
| 211 | 209 | $js_callback_catch = array_get($configuration, 'callback_catch', ''); |
@@ -288,8 +286,7 @@ discard block |
||
| 288 | 286 | curl_setopt($curl, CURLOPT_TIMEOUT, $this->curl_timeout); |
| 289 | 287 | curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); |
| 290 | 288 | $curl_response = curl_exec($curl); |
| 291 | - } |
|
| 292 | - else { |
|
| 289 | + } else { |
|
| 293 | 290 | $curl_response = file_get_contents($url); |
| 294 | 291 | } |
| 295 | 292 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | // $this->loadRoutesFrom(__DIR__ . '/routes/routes.php'); |
| 37 | 37 | $this->registerRoutes(); |
| 38 | 38 | $this->publishes([ |
| 39 | - __DIR__ . '/../config/recaptcha.php' => config_path('recaptcha.php'), |
|
| 39 | + __DIR__.'/../config/recaptcha.php' => config_path('recaptcha.php'), |
|
| 40 | 40 | ]); |
| 41 | 41 | |
| 42 | 42 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function addValidationRule() { |
| 48 | 48 | |
| 49 | - Validator::extendImplicit('recaptcha', function ($attribute, $value, $parameters, $validator) { |
|
| 49 | + Validator::extendImplicit('recaptcha', function($attribute, $value, $parameters, $validator) { |
|
| 50 | 50 | |
| 51 | 51 | return app('recaptcha')->validate($value); |
| 52 | 52 | }, trans('validation.recaptcha')); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | public function register() { |
| 61 | 61 | |
| 62 | 62 | $this->mergeConfigFrom( |
| 63 | - __DIR__ . '/../config/recaptcha.php', 'recaptcha' |
|
| 63 | + __DIR__.'/../config/recaptcha.php', 'recaptcha' |
|
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | 66 | $this->registerReCaptchaBuilder(); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | protected function registerReCaptchaBuilder() { |
| 98 | 98 | |
| 99 | - $this->app->singleton('recaptcha', function ($app) { |
|
| 99 | + $this->app->singleton('recaptcha', function($app) { |
|
| 100 | 100 | |
| 101 | 101 | $recaptcha_class = ''; |
| 102 | 102 | |