@@ -20,6 +20,8 @@ protected function getPackageProviders($app): array
2020
2121 protected function getEnvironmentSetUp ($ app ): void
2222 {
23+ $ host = env ('ELASTICSEARCH_HOST ' , 'http://localhost: ' .env ('ELASTICSEARCH_PORT ' , '9200 ' ));
24+
2325 $ app ['config ' ]->set ('database.default ' , 'elasticsearch ' );
2426
2527 $ app ['config ' ]->set ('database.connections.sqlite ' , [
@@ -33,15 +35,15 @@ protected function getEnvironmentSetUp($app): void
3335 $ app ['config ' ]->set ('database.connections.elasticsearch ' , [
3436 'driver ' => 'elasticsearch ' ,
3537 'auth_type ' => 'http ' ,
36- 'hosts ' => [' http://localhost:9200 ' ],
38+ 'hosts ' => [$ host ],
3739 'options ' => [
3840 'logging ' => true ,
3941 ],
4042 ]);
4143 $ app ['config ' ]->set ('database.connections.elasticsearch_with_default_limit ' , [
4244 'driver ' => 'elasticsearch ' ,
4345 'auth_type ' => 'http ' ,
44- 'hosts ' => [' http://localhost:9200 ' ],
46+ 'hosts ' => [$ host ],
4547 'options ' => [
4648 'default_limit ' => 4 ,
4749 'logging ' => true ,
@@ -51,7 +53,7 @@ protected function getEnvironmentSetUp($app): void
5153 $ app ['config ' ]->set ('database.connections.elasticsearch_unsafe ' , [
5254 'driver ' => 'elasticsearch ' ,
5355 'auth_type ' => 'http ' ,
54- 'hosts ' => [' http://localhost:9200 ' ],
56+ 'hosts ' => [$ host ],
5557 'options ' => [
5658 'bypass_map_validation ' => true ,
5759 'insert_chunk_size ' => 10000 ,
@@ -62,7 +64,7 @@ protected function getEnvironmentSetUp($app): void
6264 $ app ['config ' ]->set ('database.connections.elasticsearch_with_default_track_total_hits ' , [
6365 'driver ' => 'elasticsearch ' ,
6466 'auth_type ' => 'http ' ,
65- 'hosts ' => [' http://localhost:9200 ' ],
67+ 'hosts ' => [$ host ],
6668 'options ' => [
6769 'track_total_hits ' => true ,
6870 'logging ' => true ,
0 commit comments