recaptcha.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. * The site key
  16. * get site key @ www.google.com/recaptcha/admin
  17. */
  18. 'api_site_key' => env('RECAPTCHA_SITE_KEY', ''),
  19. /**
  20. * The secret key
  21. * get secret key @ www.google.com/recaptcha/admin
  22. */
  23. 'api_secret_key' => env('RECAPTCHA_SECRET_KEY', ''),
  24. /**
  25. * ReCATCHA version
  26. * Supported: "v2", "invisible", "v3",
  27. *
  28. * get more info @ https://developers.google.com/recaptcha/docs/versions
  29. */
  30. 'version' => 'v2',
  31. /**
  32. * The curl timout in seconds to validate a recaptcha token
  33. *
  34. * @since v3.5.0
  35. */
  36. 'curl_timeout' => 10,
  37. /**
  38. * IP addresses for which validation will be skipped
  39. */
  40. 'skip_ip' => [],
  41. /**
  42. * Default route called to check the Google reCAPTCHA token
  43. *
  44. * @since v3.2.0
  45. */
  46. 'default_validation_route' => 'biscolab-recaptcha/validate',
  47. /**
  48. * The name of the parameter used to send Google reCAPTCHA token to verify route
  49. *
  50. * @since v3.2.0
  51. */
  52. 'default_token_parameter_name' => 'token',
  53. /**
  54. * The default Google reCAPTCHA language code
  55. * It has no effect with v3
  56. *
  57. * @see https://developers.google.com/recaptcha/docs/language
  58. * @since v3.6.0
  59. */
  60. 'default_language' => null,
  61. /**
  62. * The default form ID. Only for "invisible" reCAPTCHA
  63. *
  64. * @since v4.0.0
  65. */
  66. 'default_form_id' => 'biscolab-recaptcha-invisible-form',
  67. /**
  68. * Deferring the render can be achieved by specifying your onload callback function and adding parameters to the JavaScript resource.
  69. * It has no effect with v3 and invisible
  70. *
  71. * @see https://developers.google.com/recaptcha/docs/display#explicit_render
  72. * @since v4.0.0
  73. * Supported true, false
  74. */
  75. 'explicit' => false,
  76. /**
  77. * Set API domain. You can use "www.recaptcha.net" in case "www.google.com" is not accessible.
  78. * (no check will be made on the entered value)
  79. *
  80. * @see https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally
  81. * @since v4.3.0
  82. * Default 'www.google.com' (ReCaptchaBuilder::DEFAULT_RECAPTCHA_API_DOMAIN)
  83. */
  84. 'api_domain' => 'www.google.com',
  85. /**
  86. * g-recaptcha tag attributes and grecaptcha.render parameters (v2 only)
  87. *
  88. * @see https://developers.google.com/recaptcha/docs/display#render_param
  89. * @since v4.0.0
  90. */
  91. 'tag_attributes' => [
  92. /**
  93. * The color theme of the widget.
  94. * Supported "light", "dark"
  95. */
  96. 'theme' => 'dark',
  97. /**
  98. * The size of the widget.
  99. * Supported "normal", "compact"
  100. */
  101. 'size' => 'normal',
  102. /**
  103. * The tabindex of the widget and challenge.
  104. * If other elements in your page use tabindex, it should be set to make user navigation easier.
  105. */
  106. 'tabindex' => 0,
  107. /**
  108. * The name of your callback function, executed when the user submits a successful response.
  109. * The g-recaptcha-response token is passed to your callback.
  110. * DO NOT SET "biscolabOnloadCallback"
  111. */
  112. 'callback' => null,
  113. /**
  114. * The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify.
  115. * DO NOT SET "biscolabOnloadCallback"
  116. */
  117. 'expired-callback' => null,
  118. /**
  119. * The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored.
  120. * If you specify a function here, you are responsible for informing the user that they should retry.
  121. * DO NOT SET "biscolabOnloadCallback"
  122. */
  123. 'error-callback' => null,
  124. ],
  125. ];