📜  laravel meilisearch flush - PHP (1)

📅  最后修改于: 2023-12-03 15:17:12.813000             🧑  作者: Mango

Laravel Meilisearch Flush

Laravel Meilisearch flush

If you are using Laravel with Meilisearch, you might need to flush the Meilisearch index to refresh the data or remove all the data at once. Laravel Meilisearch Flush provides a simple way to do that with a single command.

Installation

First, you need to install the package using Composer:

composer require ajuchacko/laravel-meilisearch-flush

Then, add the service provider to config/app.php:

'providers' => [
    // Other providers...
    Ajuchacko\LaravelMeilisearchFlush\ServiceProvider::class,
],

Finally, publish the configuration file:

php artisan vendor:publish --provider="Ajuchacko\LaravelMeilisearchFlush\ServiceProvider"
Usage

To flush the Meilisearch index, use the following command:

php artisan meilisearch:flush

You can also specify the index to flush:

php artisan meilisearch:flush users

This will flush the users index.

Options

The meilisearch:flush command supports the following options:

  • --force: Skip confirmation prompt.
  • --all: Flush all the indexes.

For example, the following command will flush all the indexes without prompt:

php artisan meilisearch:flush --force --all
Conclusion

Laravel Meilisearch Flush provides a simple way to flush the Meilisearch index in Laravel with a single command. It's a handy tool to refresh your data or remove all the data at once.