@@ -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 |
@@ -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 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function setCurlTimeout(?int $curl_timeout = null): ReCaptchaBuilder { |
| 123 | 123 | |
| 124 | - if($curl_timeout === null) { |
|
| 124 | + if ($curl_timeout === null) { |
|
| 125 | 125 | $curl_timeout = config('recaptcha.curl_timeout', ReCaptchaBuilder::DEFAULT_CURL_TIMEOUT); |
| 126 | 126 | } |
| 127 | 127 | $this->curl_timeout = $curl_timeout; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | $html .= '<script> |
| 225 | 225 | function biscolabLaravelReCaptcha(token) { |
| 226 | - document.getElementById("' . $formId . '").submit(); |
|
| 226 | + document.getElementById("' . $formId.'").submit(); |
|
| 227 | 227 | } |
| 228 | 228 | </script>'; |
| 229 | 229 | } |
@@ -248,8 +248,8 @@ discard block |
||
| 248 | 248 | |
| 249 | 249 | $validate_function = " |
| 250 | 250 | fetch('/" . config('recaptcha.default_validation_route', |
| 251 | - 'biscolab-recaptcha/validate') . "?" . config('recaptcha.default_token_parameter_name', |
|
| 252 | - 'token') . "=' + token, { |
|
| 251 | + 'biscolab-recaptcha/validate')."?".config('recaptcha.default_token_parameter_name', |
|
| 252 | + 'token')."=' + token, { |
|
| 253 | 253 | headers: { |
| 254 | 254 | \"X-Requested-With\": \"XMLHttpRequest\", |
| 255 | 255 | \"X-CSRF-TOKEN\": csrfToken.content |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | 'response' => $response, |
| 315 | 315 | ]); |
| 316 | 316 | |
| 317 | - $url = $this->api_url . '?' . $params; |
|
| 317 | + $url = $this->api_url.'?'.$params; |
|
| 318 | 318 | |
| 319 | 319 | if (function_exists('curl_version')) { |
| 320 | 320 | $curl = curl_init($url); |
@@ -226,8 +226,7 @@ discard block |
||
| 226 | 226 | document.getElementById("' . $formId . '").submit(); |
| 227 | 227 | } |
| 228 | 228 | </script>'; |
| 229 | - } |
|
| 230 | - elseif ($this->version == 'v3') { |
|
| 229 | + } elseif ($this->version == 'v3') { |
|
| 231 | 230 | |
| 232 | 231 | $action = Arr::get($configuration, 'action', 'homepage'); |
| 233 | 232 | |
@@ -237,8 +236,7 @@ discard block |
||
| 237 | 236 | if ($js_custom_validation) { |
| 238 | 237 | |
| 239 | 238 | $validate_function = ($js_custom_validation) ? "{$js_custom_validation}(token);" : ''; |
| 240 | - } |
|
| 241 | - else { |
|
| 239 | + } else { |
|
| 242 | 240 | |
| 243 | 241 | $js_then_callback = Arr::get($configuration, 'callback_then', ''); |
| 244 | 242 | $js_callback_catch = Arr::get($configuration, 'callback_catch', ''); |
@@ -323,8 +321,7 @@ discard block |
||
| 323 | 321 | curl_setopt($curl, CURLOPT_TIMEOUT, $this->curl_timeout); |
| 324 | 322 | curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); |
| 325 | 323 | $curl_response = curl_exec($curl); |
| 326 | - } |
|
| 327 | - else { |
|
| 324 | + } else { |
|
| 328 | 325 | $curl_response = file_get_contents($url); |
| 329 | 326 | } |
| 330 | 327 | |