firebase.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?php
  2. declare(strict_types=1);
  3. return [
  4. /*
  5. * ------------------------------------------------------------------------
  6. * Default Firebase project
  7. * ------------------------------------------------------------------------
  8. */
  9. 'default' => env('FIREBASE_PROJECT', 'app'),
  10. /*
  11. * ------------------------------------------------------------------------
  12. * Firebase project configurations
  13. * ------------------------------------------------------------------------
  14. */
  15. 'projects' => [
  16. 'app' => [
  17. /*
  18. * ------------------------------------------------------------------------
  19. * Credentials / Service Account
  20. * ------------------------------------------------------------------------
  21. *
  22. * In order to access a Firebase project and its related services using a
  23. * server SDK, requests must be authenticated. For server-to-server
  24. * communication this is done with a Service Account.
  25. *
  26. * If you don't already have generated a Service Account, you can do so by
  27. * following the instructions from the official documentation pages at
  28. *
  29. * https://firebase.google.com/docs/admin/setup#initialize_the_sdk
  30. *
  31. * Once you have downloaded the Service Account JSON file, you can use it
  32. * to configure the package.
  33. *
  34. * If you don't provide credentials, the Firebase Admin SDK will try to
  35. * auto-discover them
  36. *
  37. * - by checking the environment variable FIREBASE_CREDENTIALS
  38. * - by checking the environment variable GOOGLE_APPLICATION_CREDENTIALS
  39. * - by trying to find Google's well known file
  40. * - by checking if the application is running on GCE/GCP
  41. *
  42. * If no credentials file can be found, an exception will be thrown the
  43. * first time you try to access a component of the Firebase Admin SDK.
  44. *
  45. */
  46. 'credentials' => env('FIREBASE_CREDENTIALS', env('GOOGLE_APPLICATION_CREDENTIALS')),
  47. /*
  48. * ------------------------------------------------------------------------
  49. * Firebase Auth Component
  50. * ------------------------------------------------------------------------
  51. */
  52. 'auth' => [
  53. 'tenant_id' => env('FIREBASE_AUTH_TENANT_ID'),
  54. ],
  55. /*
  56. * ------------------------------------------------------------------------
  57. * Firestore Component
  58. * ------------------------------------------------------------------------
  59. */
  60. 'firestore' => [
  61. /*
  62. * If you want to access a Firestore database other than the default database,
  63. * enter its name here.
  64. *
  65. * By default, the Firestore client will connect to the `(default)` database.
  66. *
  67. * https://firebase.google.com/docs/firestore/manage-databases
  68. */
  69. // 'database' => env('FIREBASE_FIRESTORE_DATABASE'),
  70. ],
  71. /*
  72. * ------------------------------------------------------------------------
  73. * Firebase Realtime Database
  74. * ------------------------------------------------------------------------
  75. */
  76. 'database' => [
  77. /*
  78. * In most of the cases the project ID defined in the credentials file
  79. * determines the URL of your project's Realtime Database. If the
  80. * connection to the Realtime Database fails, you can override
  81. * its URL with the value you see at
  82. *
  83. * https://console.firebase.google.com/u/1/project/_/database
  84. *
  85. * Please make sure that you use a full URL like, for example,
  86. * https://my-project-id.firebaseio.com
  87. */
  88. 'url' => env('FIREBASE_DATABASE_URL'),
  89. /*
  90. * As a best practice, a service should have access to only the resources it needs.
  91. * To get more fine-grained control over the resources a Firebase app instance can access,
  92. * use a unique identifier in your Security Rules to represent your service.
  93. *
  94. * https://firebase.google.com/docs/database/admin/start#authenticate-with-limited-privileges
  95. */
  96. // 'auth_variable_override' => [
  97. // 'uid' => 'my-service-worker'
  98. // ],
  99. ],
  100. 'dynamic_links' => [
  101. /*
  102. * Dynamic links can be built with any URL prefix registered on
  103. *
  104. * https://console.firebase.google.com/u/1/project/_/durablelinks/links/
  105. *
  106. * You can define one of those domains as the default for new Dynamic
  107. * Links created within your project.
  108. *
  109. * The value must be a valid domain, for example,
  110. * https://example.page.link
  111. */
  112. 'default_domain' => env('FIREBASE_DYNAMIC_LINKS_DEFAULT_DOMAIN'),
  113. ],
  114. /*
  115. * ------------------------------------------------------------------------
  116. * Firebase Cloud Storage
  117. * ------------------------------------------------------------------------
  118. */
  119. 'storage' => [
  120. /*
  121. * Your project's default storage bucket usually uses the project ID
  122. * as its name. If you have multiple storage buckets and want to
  123. * use another one as the default for your application, you can
  124. * override it here.
  125. */
  126. 'default_bucket' => env('FIREBASE_STORAGE_DEFAULT_BUCKET'),
  127. ],
  128. /*
  129. * ------------------------------------------------------------------------
  130. * Caching
  131. * ------------------------------------------------------------------------
  132. *
  133. * The Firebase Admin SDK can cache some data returned from the Firebase
  134. * API, for example Google's public keys used to verify ID tokens.
  135. *
  136. */
  137. 'cache_store' => env('FIREBASE_CACHE_STORE', 'file'),
  138. /*
  139. * ------------------------------------------------------------------------
  140. * Logging
  141. * ------------------------------------------------------------------------
  142. *
  143. * Enable logging of HTTP interaction for insights and/or debugging.
  144. *
  145. * Log channels are defined in config/logging.php
  146. *
  147. * Successful HTTP messages are logged with the log level 'info'.
  148. * Failed HTTP messages are logged with the log level 'notice'.
  149. *
  150. * Note: Using the same channel for simple and debug logs will result in
  151. * two entries per request and response.
  152. */
  153. 'logging' => [
  154. 'http_log_channel' => env('FIREBASE_HTTP_LOG_CHANNEL'),
  155. 'http_debug_log_channel' => env('FIREBASE_HTTP_DEBUG_LOG_CHANNEL'),
  156. ],
  157. /*
  158. * ------------------------------------------------------------------------
  159. * HTTP Client Options
  160. * ------------------------------------------------------------------------
  161. *
  162. * Behavior of the HTTP Client performing the API requests
  163. */
  164. 'http_client_options' => [
  165. /*
  166. * Use a proxy that all API requests should be passed through.
  167. * (default: none)
  168. */
  169. 'proxy' => env('FIREBASE_HTTP_CLIENT_PROXY'),
  170. /*
  171. * Set the maximum amount of seconds (float) that can pass before
  172. * a request is considered timed out
  173. *
  174. * The default time out can be reviewed at
  175. * https://github.com/kreait/firebase-php/blob/6.x/src/Firebase/Http/HttpClientOptions.php
  176. */
  177. 'timeout' => env('FIREBASE_HTTP_CLIENT_TIMEOUT'),
  178. 'guzzle_middlewares' => [
  179. // MyInvokableMiddleware::class,
  180. // [MyMiddleware::class, 'static_method'],
  181. ],
  182. ],
  183. ],
  184. ],
  185. ];