B
B
BarneyGumble2021-06-03 11:41:24
Composer
BarneyGumble, 2021-06-03 11:41:24

Why can't Elasticsearch and Laravel Scout be friends?

I decided to test Elasticsearch in conjunction with Laravel Scout. I took this article as a basis (I tried others, the final result is the same as in the subject)

Attempt No. 1
composer require elasticsearch/elasticsearch - I install ES for Laravel myself
composer require laravel/scout- I install the latest version of Scout (9.1)
composer require tamayo/laravel-scout-elastic- I install the package recommended everywhere for the Scout and ES bundle

An error occurs:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - tamayo/laravel-scout-elastic[8.0.0, ..., 8.0.2] require laravel/scout ^8.0 -> found laravel/scout[v8.0.0, ..., 8.x-dev] but it conflicts with your root composer.json require (^9.1).
    - Root composer.json requires tamayo/laravel-scout-elastic ^8.0 -> satisfiable by tamayo/laravel-scout-elastic[8.0.0, 8.0.1, 8.0.2].

I understand for myself that this vaunted bundle package has not been updated on the github for half a year and I need to slip the necessary version of laravel / scout to it, so I change the procedure and do this:

Attempt No. 2
composer require elasticsearch/elasticsearch - install ES for Laravel itself
composer require tamayo/laravel-scout-elastic- install the same package, counting that he will pick up the required version of laravel/scout for himself as a dependency, in confirmation of this I see in the console that he pulled up laravel/scout: 8.6.1

Now there are no errors, I go further:

I go to config/app.php and write:
Laravel\Scout\ScoutServiceProvider::class,
ScoutEngines\Elasticsearch\ElasticsearchProvider::class,

I do I php artisan vendor:publish

get a new error:
Class 'ScoutElastic\ScoutElasticServiceProvider' not found

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kuznetsov, 2021-06-03
@BarneyGumble

According to the documentation , there is no need to specify any service providers in the app.php file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question