Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Class "ScoutEngines\Elasticsearch\ElasticsearchProvider" not found - Laravel 9 #178

Closed
amitleuva1987 opened this issue Sep 7, 2022 · 1 comment

Comments

@amitleuva1987
Copy link

Stack Versions

Laravel : 9.19
Laravel Scout : 9.4
elasticsearch/elasticsearch: 8.4
tamayo/laravel-scout-elastic: 8.1

I installed everything, then I placed below service providers in "config/app.php"

Laravel\Scout\ScoutServiceProvider::class,
ScoutEngines\Elasticsearch\ElasticsearchProvider::class,

Then I try to import models in elasticsearch using below command

sail artisan scout:import 'App\Models\Product'

I receive below error

Class "ScoutEngines\Elasticsearch\ElasticsearchProvider" not found

If I remove 'ElasticsearchProvider' class from 'config/app.php', I get below error

Elastic\Elasticsearch\ClientBuilder::setHosts(): Argument #1 ($hosts) must be of type array, null given, called in /var/www/html/vendor/tamayo/laravel-scout-elastic/src/LaravelScoutElasticProvider.php on line 23

@amitleuva1987
Copy link
Author

It doesn't really required to be placed in the service provider's list

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant