diff --git a/README.md b/README.md index f562cf2..d318a8a 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ class BookController extends Controller ## Compatibility with MeiliSearch This package is compatible with the following MeiliSearch versions: -- `v0.10.X` +- `v0.11.X` ## Development Workflow diff --git a/composer.json b/composer.json index 337a653..61622b4 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "require": { "php": "^7.2.5", "laravel/scout": "^8.0", - "meilisearch/meilisearch-php": "^0.9|^0.10" + "meilisearch/meilisearch-php": "^0.11" }, "require-dev": { "orchestra/testbench": "^5.0", diff --git a/src/Console/IndexMeilisearch.php b/src/Console/IndexMeilisearch.php index 3fed60d..77a98f4 100644 --- a/src/Console/IndexMeilisearch.php +++ b/src/Console/IndexMeilisearch.php @@ -41,14 +41,14 @@ public function handle() return; } - $index = $this->argument('name'); + $creation_options = []; if ($this->option('key')) { - $index = [ - 'uid' => $this->argument('name'), - 'primaryKey' => $this->option('key'), - ]; + $creation_options = ['primaryKey' => $this->option('key')]; } - $client->createIndex($index); + $client->createIndex( + $this->argument('name'), + $creation_options + ); $this->info('Index "'.$this->argument('name').'" created.'); } catch (HTTPRequestException $exception) { $this->error($exception->getMessage());