recaptcha.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?php
  2. /**
  3. * Copyright (c) 2017 - present
  4. * LaravelGoogleRecaptcha - recaptcha.php
  5. * author: Roberto Belotti - roby.belotti@gmail.com
  6. * web : robertobelotti.com, github.com/biscolab
  7. * Initial version created on: 12/9/2018
  8. * MIT license: https://github.com/biscolab/laravel-recaptcha/blob/master/LICENSE
  9. */
  10. /**
  11. * To configure correctly please visit https://developers.google.com/recaptcha/docs/start
  12. */
  13. return [
  14. /**
  15. *
  16. * The site key
  17. * get site key @ www.google.com/recaptcha/admin
  18. *
  19. */
  20. 'api_site_key' => env('RECAPTCHA_SITE_KEY', ''),
  21. /**
  22. *
  23. * The secret key
  24. * get secret key @ www.google.com/recaptcha/admin
  25. *
  26. */
  27. 'api_secret_key' => env('RECAPTCHA_SECRET_KEY', ''),
  28. /**
  29. *
  30. * ReCATCHA version
  31. * Supported: "v2", "invisible", "v3",
  32. *
  33. * get more info @ https://developers.google.com/recaptcha/docs/versions
  34. *
  35. */
  36. 'version' => 'v2',
  37. /**
  38. *
  39. * The curl timout in seconds to validate a recaptcha token
  40. * @since v3.5.0
  41. *
  42. */
  43. 'curl_timeout' => 10,
  44. /**
  45. *
  46. * IP addresses for which validation will be skipped
  47. * IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
  48. *
  49. */
  50. 'skip_ip' => env('RECAPTCHA_SKIP_IP', []),
  51. /**
  52. *
  53. * Default route called to check the Google reCAPTCHA token
  54. * @since v3.2.0
  55. *
  56. */
  57. 'default_validation_route' => 'biscolab-recaptcha/validate',
  58. /**
  59. *
  60. * The name of the parameter used to send Google reCAPTCHA token to verify route
  61. * @since v3.2.0
  62. *
  63. */
  64. 'default_token_parameter_name' => 'token',
  65. /**
  66. *
  67. * The default Google reCAPTCHA language code
  68. * It has no effect with v3
  69. * @see https://developers.google.com/recaptcha/docs/language
  70. * @since v3.6.0
  71. *
  72. */
  73. 'default_language' => null,
  74. /**
  75. *
  76. * The default form ID. Only for "invisible" reCAPTCHA
  77. * @since v4.0.0
  78. *
  79. */
  80. 'default_form_id' => 'biscolab-recaptcha-invisible-form',
  81. /**
  82. *
  83. * Deferring the render can be achieved by specifying your onload callback function and adding parameters to the JavaScript resource.
  84. * It has no effect with v3 and invisible
  85. * @see https://developers.google.com/recaptcha/docs/display#explicit_render
  86. * @since v4.0.0
  87. * Supported true, false
  88. *
  89. */
  90. 'explicit' => false,
  91. /**
  92. *
  93. * Set API domain. You can use "www.recaptcha.net" in case "www.google.com" is not accessible.
  94. * (no check will be made on the entered value)
  95. * @see https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally
  96. * @since v4.3.0
  97. * Default 'www.google.com' (ReCaptchaBuilder::DEFAULT_RECAPTCHA_API_DOMAIN)
  98. *
  99. */
  100. 'api_domain' => 'www.google.com',
  101. /**
  102. *
  103. * Set `true` when the error message must be null
  104. * @since v5.1.0
  105. * Default false
  106. *
  107. */
  108. 'empty_message' => false,
  109. /**
  110. *
  111. * Set either the error message or the errom message translation key
  112. * @since v5.1.0
  113. * Default 'validation.recaptcha'
  114. *
  115. */
  116. 'error_message_key' => 'validation.recaptcha',
  117. /**
  118. *
  119. * g-recaptcha tag attributes and grecaptcha.render parameters (v2 only)
  120. * @see https://developers.google.com/recaptcha/docs/display#render_param
  121. * @since v4.0.0
  122. */
  123. 'tag_attributes' => [
  124. /**
  125. * The color theme of the widget.
  126. * Supported "light", "dark"
  127. */
  128. 'theme' => 'light',
  129. /**
  130. * The size of the widget.
  131. * Supported "normal", "compact"
  132. */
  133. 'size' => 'normal',
  134. /**
  135. * The tabindex of the widget and challenge.
  136. * If other elements in your page use tabindex, it should be set to make user navigation easier.
  137. */
  138. 'tabindex' => 0,
  139. /**
  140. * The name of your callback function, executed when the user submits a successful response.
  141. * The g-recaptcha-response token is passed to your callback.
  142. * DO NOT SET "biscolabOnloadCallback"
  143. */
  144. 'callback' => null,
  145. /**
  146. * The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify.
  147. * DO NOT SET "biscolabOnloadCallback"
  148. */
  149. 'expired-callback' => null,
  150. /**
  151. * The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored.
  152. * If you specify a function here, you are responsible for informing the user that they should retry.
  153. * DO NOT SET "biscolabOnloadCallback"
  154. */
  155. 'error-callback' => null,
  156. ]
  157. ];