meilisearch / meilisearch-laravel-scout

MeiliSearch integration for Laravel Scout
https://github.com/meilisearch/MeiliSearch
MIT License
465 stars 43 forks source link

Creating index using php artisan not working #115

Closed mikhi closed 3 years ago

mikhi commented 3 years ago

Hi Guys,

Great package so far. I have a small issue: I cannot create an index using artisan command.

I get this error for: php artisan scout:index myindexname Argument 1 passed to MeiliSearch\Client::__construct() must be of the type string, null given....

I'm using: Laravel 8 PHP 7.4

Any help would be appreciated! Thanks, Mihai

mmachatschek commented 3 years ago

Hi @mikhi,

it looks like you didn't setup the meilisearch.host config under config/meilisearch.php.

Did you run both commands from the install instructions?

mikhi commented 3 years ago

Hi @mmachatschek

I followed the instructions. The MEILISEARCH_HOST & MEILISEARCH_KEY are set.

Basically any scout command is not working. image

The composer.json file looks like this: image

I'm missing something?

mmachatschek commented 3 years ago

@mikhi ahh I see where the problem is. It looks like you are using the algolia driver of scout.

This should be fixed by setting the SCOUT_DRIVER environment variable. See the link

mikhi commented 3 years ago

I already do that...

in .env file image

and in scout.php config file image

Somehow remains related with algolia driver and not meili

mmachatschek commented 3 years ago

@mikhi then the only option there could be is that you have config caching active.

Can you try running php artisan config:clear if this solves the issue?

mikhi commented 3 years ago

@mmachatschek yes, that was the case. Stupid me.. Thanks allot for your help!

mmachatschek commented 3 years ago

@mikhi happens to the best! Hope you have fun setting everything up :grin: