@@ -20,29 +20,29 @@ |
||
20 | 20 | */ |
21 | 21 | class TestCase extends OrchestraTestCase { |
22 | 22 | |
23 | - /** |
|
24 | - * Load package alias |
|
25 | - * |
|
26 | - * @param \Illuminate\Foundation\Application $app |
|
27 | - * |
|
28 | - * @return array |
|
29 | - */ |
|
30 | - protected function getPackageAliases($app) { |
|
23 | + /** |
|
24 | + * Load package alias |
|
25 | + * |
|
26 | + * @param \Illuminate\Foundation\Application $app |
|
27 | + * |
|
28 | + * @return array |
|
29 | + */ |
|
30 | + protected function getPackageAliases($app) { |
|
31 | 31 | |
32 | - return [ |
|
33 | - 'ReCaptcha' => ReCaptcha::class, |
|
34 | - ]; |
|
35 | - } |
|
32 | + return [ |
|
33 | + 'ReCaptcha' => ReCaptcha::class, |
|
34 | + ]; |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * Load package service provider |
|
39 | - * |
|
40 | - * @param \Illuminate\Foundation\Application $app |
|
41 | - * |
|
42 | - * @return array |
|
43 | - */ |
|
44 | - protected function getPackageProviders($app) { |
|
37 | + /** |
|
38 | + * Load package service provider |
|
39 | + * |
|
40 | + * @param \Illuminate\Foundation\Application $app |
|
41 | + * |
|
42 | + * @return array |
|
43 | + */ |
|
44 | + protected function getPackageProviders($app) { |
|
45 | 45 | |
46 | - return [ReCaptchaServiceProvider::class]; |
|
47 | - } |
|
46 | + return [ReCaptchaServiceProvider::class]; |
|
47 | + } |
|
48 | 48 | } |
@@ -18,13 +18,13 @@ |
||
18 | 18 | */ |
19 | 19 | class ReCaptcha extends Facade { |
20 | 20 | |
21 | - /** |
|
22 | - * Get the registered name of the component. |
|
23 | - * |
|
24 | - * @return string |
|
25 | - */ |
|
26 | - protected static function getFacadeAccessor() { |
|
21 | + /** |
|
22 | + * Get the registered name of the component. |
|
23 | + * |
|
24 | + * @return string |
|
25 | + */ |
|
26 | + protected static function getFacadeAccessor() { |
|
27 | 27 | |
28 | - return 'recaptcha'; |
|
29 | - } |
|
28 | + return 'recaptcha'; |
|
29 | + } |
|
30 | 30 | } |
@@ -11,13 +11,13 @@ discard block |
||
11 | 11 | use Biscolab\ReCaptcha\Facades\ReCaptcha; |
12 | 12 | |
13 | 13 | if (!function_exists('recaptcha')) { |
14 | - /** |
|
15 | - * @return Biscolab\ReCaptcha\ReCaptchaBuilder |
|
16 | - */ |
|
17 | - function recaptcha() { |
|
14 | + /** |
|
15 | + * @return Biscolab\ReCaptcha\ReCaptchaBuilder |
|
16 | + */ |
|
17 | + function recaptcha() { |
|
18 | 18 | |
19 | - return app('recaptcha'); |
|
20 | - } |
|
19 | + return app('recaptcha'); |
|
20 | + } |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | */ |
30 | 30 | if (!function_exists('htmlScriptTagJsApi')) { |
31 | 31 | |
32 | - /** |
|
33 | - * @param string $formId |
|
34 | - * |
|
35 | - * @return string |
|
36 | - */ |
|
37 | - function htmlScriptTagJsApi($formId = ''): string { |
|
32 | + /** |
|
33 | + * @param string $formId |
|
34 | + * |
|
35 | + * @return string |
|
36 | + */ |
|
37 | + function htmlScriptTagJsApi($formId = ''): string { |
|
38 | 38 | |
39 | - return ReCaptcha::htmlScriptTagJsApi($formId); |
|
40 | - } |
|
39 | + return ReCaptcha::htmlScriptTagJsApi($formId); |
|
40 | + } |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -49,15 +49,15 @@ discard block |
||
49 | 49 | */ |
50 | 50 | if (!function_exists('htmlScriptTagJsApiV3')) { |
51 | 51 | |
52 | - /** |
|
53 | - * @param array $config |
|
54 | - * |
|
55 | - * @return string |
|
56 | - */ |
|
57 | - function htmlScriptTagJsApiV3($config = []): string { |
|
52 | + /** |
|
53 | + * @param array $config |
|
54 | + * |
|
55 | + * @return string |
|
56 | + */ |
|
57 | + function htmlScriptTagJsApiV3($config = []): string { |
|
58 | 58 | |
59 | - return ReCaptcha::htmlScriptTagJsApiV3($config); |
|
60 | - } |
|
59 | + return ReCaptcha::htmlScriptTagJsApiV3($config); |
|
60 | + } |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -71,15 +71,15 @@ discard block |
||
71 | 71 | */ |
72 | 72 | if (!function_exists('htmlFormButton')) { |
73 | 73 | |
74 | - /** |
|
75 | - * @param null|string $buttonInnerHTML |
|
76 | - * |
|
77 | - * @return string |
|
78 | - */ |
|
79 | - function htmlFormButton(?string $buttonInnerHTML = 'Submit'): string { |
|
74 | + /** |
|
75 | + * @param null|string $buttonInnerHTML |
|
76 | + * |
|
77 | + * @return string |
|
78 | + */ |
|
79 | + function htmlFormButton(?string $buttonInnerHTML = 'Submit'): string { |
|
80 | 80 | |
81 | - return ReCaptcha::htmlFormButton($buttonInnerHTML); |
|
82 | - } |
|
81 | + return ReCaptcha::htmlFormButton($buttonInnerHTML); |
|
82 | + } |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | */ |
92 | 92 | if (!function_exists('htmlFormSnippet')) { |
93 | 93 | |
94 | - /** |
|
95 | - * @return string |
|
96 | - */ |
|
97 | - function htmlFormSnippet(): string { |
|
94 | + /** |
|
95 | + * @return string |
|
96 | + */ |
|
97 | + function htmlFormSnippet(): string { |
|
98 | 98 | |
99 | - return ReCaptcha::htmlFormSnippet(); |
|
100 | - } |
|
99 | + return ReCaptcha::htmlFormSnippet(); |
|
100 | + } |
|
101 | 101 | } |
102 | 102 |
@@ -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 |
@@ -16,26 +16,26 @@ |
||
16 | 16 | */ |
17 | 17 | class ReCaptchaBuilderV2 extends ReCaptchaBuilder { |
18 | 18 | |
19 | - /** |
|
20 | - * ReCaptchaBuilderV2 constructor. |
|
21 | - * |
|
22 | - * @param string $api_site_key |
|
23 | - * @param string $api_secret_key |
|
24 | - * @param int|null $curl_timeout |
|
25 | - */ |
|
26 | - public function __construct(string $api_site_key, string $api_secret_key, ?int $curl_timeout = null) { |
|
19 | + /** |
|
20 | + * ReCaptchaBuilderV2 constructor. |
|
21 | + * |
|
22 | + * @param string $api_site_key |
|
23 | + * @param string $api_secret_key |
|
24 | + * @param int|null $curl_timeout |
|
25 | + */ |
|
26 | + public function __construct(string $api_site_key, string $api_secret_key, ?int $curl_timeout = null) { |
|
27 | 27 | |
28 | - parent::__construct($api_site_key, $api_secret_key, 'v2', $curl_timeout); |
|
29 | - } |
|
28 | + parent::__construct($api_site_key, $api_secret_key, 'v2', $curl_timeout); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * Write ReCAPTCHA HTML tag in your FORM |
|
33 | - * Insert before </form> tag |
|
34 | - * @return string |
|
35 | - */ |
|
36 | - public function htmlFormSnippet(): string { |
|
31 | + /** |
|
32 | + * Write ReCAPTCHA HTML tag in your FORM |
|
33 | + * Insert before </form> tag |
|
34 | + * @return string |
|
35 | + */ |
|
36 | + public function htmlFormSnippet(): string { |
|
37 | 37 | |
38 | - return ($this->version == 'v2') ? '<div class="g-recaptcha" data-sitekey="' . $this->api_site_key . '"></div>' : ''; |
|
39 | - } |
|
38 | + return ($this->version == 'v2') ? '<div class="g-recaptcha" data-sitekey="' . $this->api_site_key . '"></div>' : ''; |
|
39 | + } |
|
40 | 40 | |
41 | 41 | } |
42 | 42 | \ 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 |
@@ -16,29 +16,29 @@ |
||
16 | 16 | */ |
17 | 17 | class ReCaptchaBuilderInvisible extends ReCaptchaBuilder { |
18 | 18 | |
19 | - /** |
|
20 | - * ReCaptchaBuilderInvisible constructor. |
|
21 | - * |
|
22 | - * @param string $api_site_key |
|
23 | - * @param string $api_secret_key |
|
24 | - * @param int|null $curl_timeout |
|
25 | - */ |
|
26 | - public function __construct(string $api_site_key, string $api_secret_key, ?int $curl_timeout = null) { |
|
19 | + /** |
|
20 | + * ReCaptchaBuilderInvisible constructor. |
|
21 | + * |
|
22 | + * @param string $api_site_key |
|
23 | + * @param string $api_secret_key |
|
24 | + * @param int|null $curl_timeout |
|
25 | + */ |
|
26 | + public function __construct(string $api_site_key, string $api_secret_key, ?int $curl_timeout = null) { |
|
27 | 27 | |
28 | - parent::__construct($api_site_key, $api_secret_key, 'invisible', $curl_timeout); |
|
29 | - } |
|
28 | + parent::__construct($api_site_key, $api_secret_key, 'invisible', $curl_timeout); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * Write HTML <button> tag in your HTML code |
|
33 | - * Insert before </form> tag |
|
34 | - * |
|
35 | - * @param string $buttonInnerHTML |
|
36 | - * |
|
37 | - * @return string |
|
38 | - */ |
|
39 | - public function htmlFormButton($buttonInnerHTML = 'Submit'): string { |
|
31 | + /** |
|
32 | + * Write HTML <button> tag in your HTML code |
|
33 | + * Insert before </form> tag |
|
34 | + * |
|
35 | + * @param string $buttonInnerHTML |
|
36 | + * |
|
37 | + * @return string |
|
38 | + */ |
|
39 | + public function htmlFormButton($buttonInnerHTML = 'Submit'): string { |
|
40 | 40 | |
41 | - return ($this->version == 'invisible') ? '<button class="g-recaptcha" data-sitekey="' . $this->api_site_key . '" data-callback="biscolabLaravelReCaptcha">' . $buttonInnerHTML . '</button>' : ''; |
|
42 | - } |
|
41 | + return ($this->version == 'invisible') ? '<button class="g-recaptcha" data-sitekey="' . $this->api_site_key . '" data-callback="biscolabLaravelReCaptcha">' . $buttonInnerHTML . '</button>' : ''; |
|
42 | + } |
|
43 | 43 | |
44 | 44 | } |
45 | 45 | \ No newline at end of file |
@@ -18,12 +18,12 @@ |
||
18 | 18 | */ |
19 | 19 | class ReCaptchaController extends Controller { |
20 | 20 | |
21 | - /** |
|
22 | - * @return array |
|
23 | - */ |
|
24 | - public function validateV3(): array { |
|
21 | + /** |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function validateV3(): array { |
|
25 | 25 | |
26 | - $token = request()->input(config('recaptcha.default_token_parameter_name', 'token'), ''); |
|
27 | - return recaptcha()->validate($token); |
|
28 | - } |
|
26 | + $token = request()->input(config('recaptcha.default_token_parameter_name', 'token'), ''); |
|
27 | + return recaptcha()->validate($token); |
|
28 | + } |
|
29 | 29 | } |
30 | 30 | \ 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 |
@@ -20,103 +20,103 @@ |
||
20 | 20 | */ |
21 | 21 | class ReCaptchaServiceProvider extends ServiceProvider { |
22 | 22 | |
23 | - /** |
|
24 | - * Indicates if loading of the provider is deferred. |
|
25 | - * |
|
26 | - * @var bool |
|
27 | - */ |
|
28 | - protected $defer = false; |
|
29 | - |
|
30 | - /** |
|
31 | - * |
|
32 | - */ |
|
33 | - public function boot() { |
|
34 | - |
|
35 | - $this->addValidationRule(); |
|
23 | + /** |
|
24 | + * Indicates if loading of the provider is deferred. |
|
25 | + * |
|
26 | + * @var bool |
|
27 | + */ |
|
28 | + protected $defer = false; |
|
29 | + |
|
30 | + /** |
|
31 | + * |
|
32 | + */ |
|
33 | + public function boot() { |
|
34 | + |
|
35 | + $this->addValidationRule(); |
|
36 | 36 | // $this->loadRoutesFrom(__DIR__ . '/routes/routes.php'); |
37 | - $this->registerRoutes(); |
|
38 | - $this->publishes([ |
|
39 | - __DIR__ . '/../config/recaptcha.php' => config_path('recaptcha.php'), |
|
40 | - ]); |
|
41 | - |
|
42 | - } |
|
43 | - |
|
44 | - /** |
|
45 | - * Extends Validator to include a recaptcha type |
|
46 | - */ |
|
47 | - public function addValidationRule() { |
|
48 | - |
|
49 | - Validator::extendImplicit('recaptcha', function ($attribute, $value, $parameters, $validator) { |
|
50 | - |
|
51 | - return app('recaptcha')->validate($value); |
|
52 | - }, trans('validation.recaptcha')); |
|
53 | - } |
|
54 | - |
|
55 | - /** |
|
56 | - * Register the service provider. |
|
57 | - * |
|
58 | - * @return void |
|
59 | - */ |
|
60 | - public function register() { |
|
61 | - |
|
62 | - $this->mergeConfigFrom( |
|
63 | - __DIR__ . '/../config/recaptcha.php', 'recaptcha' |
|
64 | - ); |
|
65 | - |
|
66 | - $this->registerReCaptchaBuilder(); |
|
67 | - } |
|
68 | - |
|
69 | - /** |
|
70 | - * Get the services provided by the provider. |
|
71 | - * |
|
72 | - * @return array |
|
73 | - */ |
|
74 | - public function provides(): array { |
|
75 | - |
|
76 | - return ['recaptcha']; |
|
77 | - } |
|
78 | - |
|
79 | - /** |
|
80 | - * @return ReCaptchaServiceProvider |
|
81 | - * |
|
82 | - * @since v3.4.1 |
|
83 | - */ |
|
84 | - protected function registerRoutes(): ReCaptchaServiceProvider { |
|
85 | - |
|
86 | - Route::get( |
|
87 | - config('recaptcha.default_validation_route', 'biscolab-recaptcha/validate'), |
|
88 | - ['uses' => 'Biscolab\ReCaptcha\Controllers\ReCaptchaController@validateV3'] |
|
89 | - )->middleware('web'); |
|
90 | - |
|
91 | - return $this; |
|
92 | - } |
|
93 | - |
|
94 | - /** |
|
95 | - * Register the HTML builder instance. |
|
96 | - * |
|
97 | - * @return void |
|
98 | - */ |
|
99 | - protected function registerReCaptchaBuilder() { |
|
100 | - |
|
101 | - $this->app->singleton('recaptcha', function ($app) { |
|
102 | - |
|
103 | - $recaptcha_class = ''; |
|
104 | - |
|
105 | - switch (config('recaptcha.version')) { |
|
106 | - case 'v3' : |
|
107 | - $recaptcha_class = ReCaptchaBuilderV3::class; |
|
108 | - break; |
|
109 | - case 'v2' : |
|
110 | - $recaptcha_class = ReCaptchaBuilderV2::class; |
|
111 | - break; |
|
112 | - case 'invisible': |
|
113 | - $recaptcha_class = ReCaptchaBuilderInvisible::class; |
|
114 | - break; |
|
115 | - } |
|
116 | - |
|
117 | - return new $recaptcha_class(config('recaptcha.api_site_key'), config('recaptcha.api_secret_key'), config('recaptcha.curl_timeout')); |
|
118 | - |
|
119 | - }); |
|
120 | - } |
|
37 | + $this->registerRoutes(); |
|
38 | + $this->publishes([ |
|
39 | + __DIR__ . '/../config/recaptcha.php' => config_path('recaptcha.php'), |
|
40 | + ]); |
|
41 | + |
|
42 | + } |
|
43 | + |
|
44 | + /** |
|
45 | + * Extends Validator to include a recaptcha type |
|
46 | + */ |
|
47 | + public function addValidationRule() { |
|
48 | + |
|
49 | + Validator::extendImplicit('recaptcha', function ($attribute, $value, $parameters, $validator) { |
|
50 | + |
|
51 | + return app('recaptcha')->validate($value); |
|
52 | + }, trans('validation.recaptcha')); |
|
53 | + } |
|
54 | + |
|
55 | + /** |
|
56 | + * Register the service provider. |
|
57 | + * |
|
58 | + * @return void |
|
59 | + */ |
|
60 | + public function register() { |
|
61 | + |
|
62 | + $this->mergeConfigFrom( |
|
63 | + __DIR__ . '/../config/recaptcha.php', 'recaptcha' |
|
64 | + ); |
|
65 | + |
|
66 | + $this->registerReCaptchaBuilder(); |
|
67 | + } |
|
68 | + |
|
69 | + /** |
|
70 | + * Get the services provided by the provider. |
|
71 | + * |
|
72 | + * @return array |
|
73 | + */ |
|
74 | + public function provides(): array { |
|
75 | + |
|
76 | + return ['recaptcha']; |
|
77 | + } |
|
78 | + |
|
79 | + /** |
|
80 | + * @return ReCaptchaServiceProvider |
|
81 | + * |
|
82 | + * @since v3.4.1 |
|
83 | + */ |
|
84 | + protected function registerRoutes(): ReCaptchaServiceProvider { |
|
85 | + |
|
86 | + Route::get( |
|
87 | + config('recaptcha.default_validation_route', 'biscolab-recaptcha/validate'), |
|
88 | + ['uses' => 'Biscolab\ReCaptcha\Controllers\ReCaptchaController@validateV3'] |
|
89 | + )->middleware('web'); |
|
90 | + |
|
91 | + return $this; |
|
92 | + } |
|
93 | + |
|
94 | + /** |
|
95 | + * Register the HTML builder instance. |
|
96 | + * |
|
97 | + * @return void |
|
98 | + */ |
|
99 | + protected function registerReCaptchaBuilder() { |
|
100 | + |
|
101 | + $this->app->singleton('recaptcha', function ($app) { |
|
102 | + |
|
103 | + $recaptcha_class = ''; |
|
104 | + |
|
105 | + switch (config('recaptcha.version')) { |
|
106 | + case 'v3' : |
|
107 | + $recaptcha_class = ReCaptchaBuilderV3::class; |
|
108 | + break; |
|
109 | + case 'v2' : |
|
110 | + $recaptcha_class = ReCaptchaBuilderV2::class; |
|
111 | + break; |
|
112 | + case 'invisible': |
|
113 | + $recaptcha_class = ReCaptchaBuilderInvisible::class; |
|
114 | + break; |
|
115 | + } |
|
116 | + |
|
117 | + return new $recaptcha_class(config('recaptcha.api_site_key'), config('recaptcha.api_secret_key'), config('recaptcha.curl_timeout')); |
|
118 | + |
|
119 | + }); |
|
120 | + } |
|
121 | 121 | |
122 | 122 | } |
@@ -13,60 +13,60 @@ |
||
13 | 13 | */ |
14 | 14 | return [ |
15 | 15 | |
16 | - /** |
|
17 | - * |
|
18 | - * The site key |
|
19 | - * get site key @ www.google.com/recaptcha/admin |
|
20 | - * |
|
21 | - */ |
|
22 | - 'api_site_key' => env('RECAPTCHA_SITE_KEY', ''), |
|
16 | + /** |
|
17 | + * |
|
18 | + * The site key |
|
19 | + * get site key @ www.google.com/recaptcha/admin |
|
20 | + * |
|
21 | + */ |
|
22 | + 'api_site_key' => env('RECAPTCHA_SITE_KEY', ''), |
|
23 | 23 | |
24 | - /** |
|
25 | - * |
|
26 | - * The secret key |
|
27 | - * get secret key @ www.google.com/recaptcha/admin |
|
28 | - * |
|
29 | - */ |
|
30 | - 'api_secret_key' => env('RECAPTCHA_SECRET_KEY', ''), |
|
24 | + /** |
|
25 | + * |
|
26 | + * The secret key |
|
27 | + * get secret key @ www.google.com/recaptcha/admin |
|
28 | + * |
|
29 | + */ |
|
30 | + 'api_secret_key' => env('RECAPTCHA_SECRET_KEY', ''), |
|
31 | 31 | |
32 | - /** |
|
33 | - * |
|
34 | - * ReCATCHA version |
|
35 | - * Supported: "v2", "invisible", "v3", |
|
36 | - * |
|
37 | - * get more info @ https://developers.google.com/recaptcha/docs/versions |
|
38 | - * |
|
39 | - */ |
|
40 | - 'version' => env('RECAPTCHA_DEFAULT_VERSION', 'v2'), |
|
32 | + /** |
|
33 | + * |
|
34 | + * ReCATCHA version |
|
35 | + * Supported: "v2", "invisible", "v3", |
|
36 | + * |
|
37 | + * get more info @ https://developers.google.com/recaptcha/docs/versions |
|
38 | + * |
|
39 | + */ |
|
40 | + 'version' => env('RECAPTCHA_DEFAULT_VERSION', 'v2'), |
|
41 | 41 | |
42 | - /** |
|
43 | - * |
|
44 | - * The curl timout in seconds to validate a recaptcha token |
|
45 | - * @since v3.5.0 |
|
46 | - * |
|
47 | - */ |
|
48 | - 'curl_timeout' => env('RECAPTCHA_CURL_TIMEOUT', 10), |
|
42 | + /** |
|
43 | + * |
|
44 | + * The curl timout in seconds to validate a recaptcha token |
|
45 | + * @since v3.5.0 |
|
46 | + * |
|
47 | + */ |
|
48 | + 'curl_timeout' => env('RECAPTCHA_CURL_TIMEOUT', 10), |
|
49 | 49 | |
50 | - /** |
|
51 | - * |
|
52 | - * IP addresses for which validation will be skipped |
|
53 | - * |
|
54 | - */ |
|
55 | - 'skip_ip' => [], |
|
50 | + /** |
|
51 | + * |
|
52 | + * IP addresses for which validation will be skipped |
|
53 | + * |
|
54 | + */ |
|
55 | + 'skip_ip' => [], |
|
56 | 56 | |
57 | - /** |
|
58 | - * |
|
59 | - * Default route called to check the Google reCAPTCHA token |
|
60 | - * @since v3.2.0 |
|
61 | - * |
|
62 | - */ |
|
63 | - 'default_validation_route' => env('RECAPTCHA_DEFAULT_VALIDATION_ROUTE', 'biscolab-recaptcha/validate'), |
|
57 | + /** |
|
58 | + * |
|
59 | + * Default route called to check the Google reCAPTCHA token |
|
60 | + * @since v3.2.0 |
|
61 | + * |
|
62 | + */ |
|
63 | + 'default_validation_route' => env('RECAPTCHA_DEFAULT_VALIDATION_ROUTE', 'biscolab-recaptcha/validate'), |
|
64 | 64 | |
65 | - /** |
|
66 | - * |
|
67 | - * The name of the parameter used to send Google reCAPTCHA token to verify route |
|
68 | - * @since v3.2.0 |
|
69 | - * |
|
70 | - */ |
|
71 | - 'default_token_parameter_name' => env('RECAPTCHA_DEFAULT_TOKEN_PARAMETER_NAME', 'token') |
|
65 | + /** |
|
66 | + * |
|
67 | + * The name of the parameter used to send Google reCAPTCHA token to verify route |
|
68 | + * @since v3.2.0 |
|
69 | + * |
|
70 | + */ |
|
71 | + 'default_token_parameter_name' => env('RECAPTCHA_DEFAULT_TOKEN_PARAMETER_NAME', 'token') |
|
72 | 72 | ]; |
@@ -16,16 +16,16 @@ |
||
16 | 16 | */ |
17 | 17 | class ReCaptchaBuilderV3 extends ReCaptchaBuilder { |
18 | 18 | |
19 | - /** |
|
20 | - * ReCaptchaBuilderV3 constructor. |
|
21 | - * |
|
22 | - * @param string $api_site_key |
|
23 | - * @param string $api_secret_key |
|
24 | - * @param int|null $curl_timeout |
|
25 | - */ |
|
26 | - public function __construct(string $api_site_key, string $api_secret_key, ?int $curl_timeout = null) { |
|
19 | + /** |
|
20 | + * ReCaptchaBuilderV3 constructor. |
|
21 | + * |
|
22 | + * @param string $api_site_key |
|
23 | + * @param string $api_secret_key |
|
24 | + * @param int|null $curl_timeout |
|
25 | + */ |
|
26 | + public function __construct(string $api_site_key, string $api_secret_key, ?int $curl_timeout = null) { |
|
27 | 27 | |
28 | - parent::__construct($api_site_key, $api_secret_key, 'v3', $curl_timeout); |
|
29 | - } |
|
28 | + parent::__construct($api_site_key, $api_secret_key, 'v3', $curl_timeout); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | } |
32 | 32 | \ No newline at end of file |