@@ -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 |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | $html .= '<script> |
| 152 | 152 | function biscolabLaravelReCaptcha(token) { |
| 153 | - document.getElementById("' . $formId . '").submit(); |
|
| 153 | + document.getElementById("' . $formId.'").submit(); |
|
| 154 | 154 | } |
| 155 | 155 | </script>'; |
| 156 | 156 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $js_callback_catch = ($js_callback_catch) ? "{$js_callback_catch}(err)" : ''; |
| 175 | 175 | |
| 176 | 176 | $validate_function = " |
| 177 | - fetch('/" . config('recaptcha.default_validation_route', 'biscolab-recaptcha/validate') . "?" . config('recaptcha.default_token_parameter_name', 'token') . "=' + token, { |
|
| 177 | + fetch('/" . config('recaptcha.default_validation_route', 'biscolab-recaptcha/validate')."?".config('recaptcha.default_token_parameter_name', 'token')."=' + token, { |
|
| 178 | 178 | headers: { |
| 179 | 179 | \"X-Requested-With\": \"XMLHttpRequest\", |
| 180 | 180 | \"X-CSRF-TOKEN\": csrfToken.content |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | 'response' => $response, |
| 231 | 231 | ]); |
| 232 | 232 | |
| 233 | - $url = $this->api_url . '?' . $params; |
|
| 233 | + $url = $this->api_url.'?'.$params; |
|
| 234 | 234 | |
| 235 | 235 | if (function_exists('curl_version')) { |
| 236 | 236 | $curl = curl_init($url); |
@@ -153,8 +153,7 @@ discard block |
||
| 153 | 153 | document.getElementById("' . $formId . '").submit(); |
| 154 | 154 | } |
| 155 | 155 | </script>'; |
| 156 | - } |
|
| 157 | - elseif ($this->version == 'v3') { |
|
| 156 | + } elseif ($this->version == 'v3') { |
|
| 158 | 157 | |
| 159 | 158 | $action = array_get($configuration, 'action', 'homepage'); |
| 160 | 159 | |
@@ -164,8 +163,7 @@ discard block |
||
| 164 | 163 | if ($js_custom_validation) { |
| 165 | 164 | |
| 166 | 165 | $validate_function = ($js_custom_validation) ? "{$js_custom_validation}(token);" : ''; |
| 167 | - } |
|
| 168 | - else { |
|
| 166 | + } else { |
|
| 169 | 167 | |
| 170 | 168 | $js_then_callback = array_get($configuration, 'callback_then', ''); |
| 171 | 169 | $js_callback_catch = array_get($configuration, 'callback_catch', ''); |
@@ -239,8 +237,7 @@ discard block |
||
| 239 | 237 | curl_setopt($curl, CURLOPT_TIMEOUT, 1); |
| 240 | 238 | curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); |
| 241 | 239 | $curl_response = curl_exec($curl); |
| 242 | - } |
|
| 243 | - else { |
|
| 240 | + } else { |
|
| 244 | 241 | $curl_response = file_get_contents($url); |
| 245 | 242 | } |
| 246 | 243 | if (is_null($curl_response) || empty($curl_response)) { |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | public function boot() { |
| 33 | 33 | |
| 34 | 34 | $this->addValidationRule(); |
| 35 | - $this->loadRoutesFrom(__DIR__ . '/routes/routes.php'); |
|
| 35 | + $this->loadRoutesFrom(__DIR__.'/routes/routes.php'); |
|
| 36 | 36 | |
| 37 | 37 | $this->publishes([ |
| 38 | - __DIR__ . '/../config/recaptcha.php' => config_path('recaptcha.php'), |
|
| 38 | + __DIR__.'/../config/recaptcha.php' => config_path('recaptcha.php'), |
|
| 39 | 39 | ]); |
| 40 | 40 | |
| 41 | 41 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function addValidationRule() { |
| 47 | 47 | |
| 48 | - Validator::extendImplicit('recaptcha', function ($attribute, $value, $parameters, $validator) { |
|
| 48 | + Validator::extendImplicit('recaptcha', function($attribute, $value, $parameters, $validator) { |
|
| 49 | 49 | |
| 50 | 50 | return app('recaptcha')->validate($value); |
| 51 | 51 | }, trans('validation.recaptcha')); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function register() { |
| 60 | 60 | |
| 61 | 61 | $this->mergeConfigFrom( |
| 62 | - __DIR__ . '/../config/recaptcha.php', 'recaptcha' |
|
| 62 | + __DIR__.'/../config/recaptcha.php', 'recaptcha' |
|
| 63 | 63 | ); |
| 64 | 64 | |
| 65 | 65 | $this->registerReCaptchaBuilder(); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | protected function registerReCaptchaBuilder() { |
| 74 | 74 | |
| 75 | - $this->app->singleton('recaptcha', function ($app) { |
|
| 75 | + $this->app->singleton('recaptcha', function($app) { |
|
| 76 | 76 | |
| 77 | 77 | $recaptcha_class = ''; |
| 78 | 78 | |