| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- return [
- /**
- * Here you can specify the connection to use when building a client.
- */
- 'connection' => 'default',
- /**
- * These are the available connections parameters that you can use to connect
- */
- 'connections' => [
- 'default' => [
- 'hosts' => [
- env('ELASTICSEARCH_HOST', 'http://localhost:9200'),
- ],
- 'user' => env('ELASTICSEARCH_USER', null),
- 'pass' => env('ELASTICSEARCH_PASS', null),
- ],
- /**
- * You can connect with API key authentication by setting the `api` key
- * instead of the `user` and `pass` keys.
- */
- 'api' => [
- 'hosts' => [
- env('ELASTICSEARCH_HOST', null),
- ],
- 'key' => env('ELASTICSEARCH_API_KEY', null),
- ],
- /**
- * You can connect to Elastic Cloud with the Cloud ID using the `cloud` key.
- */
- 'cloud' => [
- 'id' => env('ELASTICSEARCH_CLOUD_ID', null),
- /**
- * If you are authenticating with API KEY then set user and pass as null
- */
- 'api_key' => env('ELASTICSEARCH_API_KEY', null),
- /**
- * If you are authenticating with username and password then set api_key as null
- */
- 'user' => env('ELASTICSEARCH_USER', null),
- 'pass' => env('ELASTICSEARCH_PASS', null),
- ],
- ],
- /**
- * CA Bundle
- *
- * OrbStack (*.orb.local) uses its own root CA; direct ES uses http_ca.crt.
- * Override with ELASTICSEARCH_CA_BUNDLE in .env when needed.
- *
- * @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/connecting.html#auth-http
- */
- 'caBundle' => (function () {
- $bundle = env('ELASTICSEARCH_CA_BUNDLE');
- if ($bundle && ! str_starts_with($bundle, '/')) {
- $bundle = base_path($bundle);
- }
- if ($bundle && is_readable($bundle)) {
- return $bundle;
- }
- foreach ([public_path('orbstack_ca.crt'), public_path('elastic_ca.crt')] as $candidate) {
- if (is_readable($candidate)) {
- return $candidate;
- }
- }
- return null;
- })(),
- /**
- * Retries
- *
- * By default, the client will retry n times, where n = number of nodes in
- * your cluster. If you would like to disable retries, or change the number,
- * you can do so here.
- *
- * @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/set-retries.html
- */
- 'retries' => null,
- ];
|