recaptcha.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. *
  48. */
  49. 'skip_ip' => [],
  50. /**
  51. *
  52. * Default route called to check the Google reCAPTCHA token
  53. * @since v3.2.0
  54. *
  55. */
  56. 'default_validation_route' => 'biscolab-recaptcha/validate',
  57. /**
  58. *
  59. * The name of the parameter used to send Google reCAPTCHA token to verify route
  60. * @since v3.2.0
  61. *
  62. */
  63. 'default_token_parameter_name' => 'token',
  64. /**
  65. *
  66. * The default Google reCAPTCHA language code
  67. * It has no effect with v3
  68. * @see https://developers.google.com/recaptcha/docs/language
  69. * @since v3.6.0
  70. *
  71. */
  72. 'default_language' => null,
  73. /**
  74. *
  75. * The default form ID. Only for "invisible" reCAPTCHA
  76. * @since v4.0.0
  77. *
  78. */
  79. 'default_form_id' => 'biscolab-recaptcha-invisible-form',
  80. /**
  81. *
  82. * Deferring the render can be achieved by specifying your onload callback function and adding parameters to the JavaScript resource.
  83. * It has no effect with v3 and invisible
  84. * @see https://developers.google.com/recaptcha/docs/display#explicit_render
  85. * @since v4.0.0
  86. * Supported true, false
  87. *
  88. */
  89. 'explicit' => false,
  90. /**
  91. *
  92. * Set API domain. You can use "www.recaptcha.net" in case "www.google.com" is not accessible.
  93. * (no check will be made on the entered value)
  94. * @see https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally
  95. * @since v4.3.0
  96. * Default 'www.google.com' (ReCaptchaBuilder::DEFAULT_RECAPTCHA_API_DOMAIN)
  97. *
  98. */
  99. 'api_domain' => 'www.google.com',
  100. /**
  101. *
  102. * g-recaptcha tag attributes and grecaptcha.render parameters (v2 only)
  103. * @see https://developers.google.com/recaptcha/docs/display#render_param
  104. * @since v4.0.0
  105. */
  106. 'tag_attributes' => [
  107. /**
  108. * The color theme of the widget.
  109. * Supported "light", "dark"
  110. */
  111. 'theme' => 'dark',
  112. /**
  113. * The size of the widget.
  114. * Supported "normal", "compact"
  115. */
  116. 'size' => 'normal',
  117. /**
  118. * The tabindex of the widget and challenge.
  119. * If other elements in your page use tabindex, it should be set to make user navigation easier.
  120. */
  121. 'tabindex' => 0,
  122. /**
  123. * The name of your callback function, executed when the user submits a successful response.
  124. * The g-recaptcha-response token is passed to your callback.
  125. * DO NOT SET "biscolabOnloadCallback"
  126. */
  127. 'callback' => null,
  128. /**
  129. * The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify.
  130. * DO NOT SET "biscolabOnloadCallback"
  131. */
  132. 'expired-callback' => null,
  133. /**
  134. * The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored.
  135. * If you specify a function here, you are responsible for informing the user that they should retry.
  136. * DO NOT SET "biscolabOnloadCallback"
  137. */
  138. 'error-callback' => null,
  139. ]
  140. ];