Meilitools offers advanced Meilisearch index features in Laravel Scout

September 22nd, 2022

laravel-scout-featured.png

Laravel Meilitools provides additional tools for Laravel Scout 9+ integration with MeiliSearch. This package aims to open the possibility of using advanced filtering easily and sorting through Laravel Scout without manually diving into the internals of the Meilisearch API.

Here's an example from the package's readme of setting up indexes for a model by implementing the MeiliSettings interface:

1use Dwarf\MeiliTools\Contracts\Indexes\MeiliSettings;
2use Illuminate\Database\Eloquent\Model;
3use Laravel\Scout\Searchable;
4 
5class Article extends Model implements MeiliSettings
6{
7 use Searchable;
8 
9 /**
10 * {@inheritdoc}
11 */
12 public function meiliSettings(): array
13 {
14 return ['filterableAttributes' => ['status']];
15 }
16}

This package also includes useful Artisan commands for things like getting the details of an index, resetting the settings of an index, and more.

If you are experimenting with Meilisearch and Scout, check out our Getting started with Laravel Scout and Meilisearch tutorial.

You can get started with this package on GitHub at dwarfhq/laravel-meilitools.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.

Laravel News Partners