firebase.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. /*
  101. * ------------------------------------------------------------------------
  102. * Firebase Cloud Storage
  103. * ------------------------------------------------------------------------
  104. */
  105. 'storage' => [
  106. /*
  107. * Your project's default storage bucket usually uses the project ID
  108. * as its name. If you have multiple storage buckets and want to
  109. * use another one as the default for your application, you can
  110. * override it here.
  111. */
  112. 'default_bucket' => env('FIREBASE_STORAGE_DEFAULT_BUCKET'),
  113. ],
  114. /*
  115. * ------------------------------------------------------------------------
  116. * Caching
  117. * ------------------------------------------------------------------------
  118. *
  119. * The Firebase Admin SDK can cache some data returned from the Firebase
  120. * API, for example Google's public keys used to verify ID tokens.
  121. *
  122. */
  123. 'cache_store' => env('FIREBASE_CACHE_STORE', 'file'),
  124. /*
  125. * ------------------------------------------------------------------------
  126. * Logging
  127. * ------------------------------------------------------------------------
  128. *
  129. * Enable logging of HTTP interaction for insights and/or debugging.
  130. *
  131. * Log channels are defined in config/logging.php
  132. *
  133. * Successful HTTP messages are logged with the log level 'info'.
  134. * Failed HTTP messages are logged with the log level 'notice'.
  135. *
  136. * Note: Using the same channel for simple and debug logs will result in
  137. * two entries per request and response.
  138. */
  139. 'logging' => [
  140. 'http_log_channel' => env('FIREBASE_HTTP_LOG_CHANNEL'),
  141. 'http_debug_log_channel' => env('FIREBASE_HTTP_DEBUG_LOG_CHANNEL'),
  142. ],
  143. /*
  144. * ------------------------------------------------------------------------
  145. * HTTP Client Options
  146. * ------------------------------------------------------------------------
  147. *
  148. * Behavior of the HTTP Client performing the API requests
  149. */
  150. 'http_client_options' => [
  151. /*
  152. * Use a proxy that all API requests should be passed through.
  153. * (default: none)
  154. */
  155. 'proxy' => env('FIREBASE_HTTP_CLIENT_PROXY'),
  156. /*
  157. * Set the maximum amount of seconds (float) that can pass before
  158. * a request is considered timed out
  159. *
  160. * The default time out can be reviewed at
  161. * https://github.com/beste/firebase-php/blob/6.x/src/Firebase/Http/HttpClientOptions.php
  162. */
  163. 'timeout' => env('FIREBASE_HTTP_CLIENT_TIMEOUT'),
  164. 'guzzle_middlewares' => [
  165. // MyInvokableMiddleware::class,
  166. // [MyMiddleware::class, 'static_method'],
  167. ],
  168. ],
  169. ],
  170. ],
  171. ];