PHPackages                             dwarfdk/laravel-meilitools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. dwarfdk/laravel-meilitools

ActiveLibrary[Search &amp; Filtering](/categories/search)

dwarfdk/laravel-meilitools
==========================

Additional tools for Laravel Scout integration with MeiliSearch

0.4.0(9mo ago)10022.4k↓33.9%9[1 PRs](https://github.com/dwarfhq/laravel-meilitools/pulls)MITPHPPHP ^8.2CI passing

Since Jun 21Pushed 5mo ago6 watchersCompare

[ Source](https://github.com/dwarfhq/laravel-meilitools)[ Packagist](https://packagist.org/packages/dwarfdk/laravel-meilitools)[ RSS](/packages/dwarfdk-laravel-meilitools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (12)Versions (13)Used By (0)

Laravel MeiliTools
==================

[](#laravel-meilitools)

[![PHP](https://camo.githubusercontent.com/17b5eb33888d61aae1b0d686bab3f1fbeda41427e622d12e80c80b874dd082c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6477617266646b2f6c61726176656c2d6d65696c69746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dwarfdk/laravel-meilitools)[![Packagist](https://camo.githubusercontent.com/5ac4d6ac4980954eadb8ded1bfcafca99dd668660e83dfb8f2c576b969f947a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6477617266646b2f6c61726176656c2d6d65696c69746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dwarfdk/laravel-meilitools)[![Downloads](https://camo.githubusercontent.com/b0bdeba5d9754caa591080dc66a3c6f2e1a0023b2674ecf19584b2f7def429d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6477617266646b2f6c61726176656c2d6d65696c69746f6f6c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dwarfdk/laravel-meilitools)[![License](https://camo.githubusercontent.com/3e000b75b4e67ce7abde3fe4ed3e4fd2d0317b39c6d2673caf0e9693a76677ee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f647761726668712f6c61726176656c2d6d65696c69746f6f6c732e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![GitHub Workflow Status](https://camo.githubusercontent.com/1a711e72e8a1a92230a820ba902987393a4ed1ccf14488822ed76d626a53c02d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f647761726668712f6c61726176656c2d6d65696c69746f6f6c732f74657374732e796d6c3f6272616e63683d6d61696e)](https://github.com/dwarfhq/laravel-meilitools/actions)

The purpose of this package is to ease the configuration of indexes for MeiliSearch, so it's possible to use advanced filtering and sorting through Laravel Scout, without having to meddle with their API manually.

Table of Contents
-----------------

[](#table-of-contents)

- [Compatibility](#compatibility)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
    - [Model Settings](#model-settings)
    - [Commands](#commands)
- [Examples](#examples)
- [Testing](#testing)
- [License](#license)

Compatibility
-------------

[](#compatibility)

Engine0.1.x0.2.x0.3.x0.4.xv0.26.xXXv0.27.xXXv0.28.xXv0.29.xXv0.30.xXv1.x.xXInstallation
------------

[](#installation)

Install this package via Composer:

```
$ composer require dwarfdk/laravel-meilitools
```

Configuration
-------------

[](#configuration)

Publish config using Artisan command:

```
$ php artisan vendor:publish --provider="Dwarf\MeiliTools\MeiliToolsServiceProvider"
```

Change configuration through `config/meilitools.php`.

Usage
-----

[](#usage)

This package provides commands and helpers to ease the use of configuring MeiliSearch indexes.

### Model Settings

[](#model-settings)

Setup index settings for a model by implementing the method provided by the contract.

```
use Dwarf\MeiliTools\Contracts\Indexes\MeiliSettings;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Laravel\Scout\Searchable;

class Article extends Model implements MeiliSettings
{
    use Searchable;
    use SoftDeletes;

    /**
     * {@inheritdoc}
     */
    public function meiliSettings(): array
    {
        // When using soft deletes '__soft_deleted' will automatically be added to filterable attributes.
        return ['filterableAttributes' => ['status']];
    }
}
```

A full list of available index settings can be found [here](https://docs.meilisearch.com/learn/configuration/settings.html).

### Commands

[](#commands)

The following commands are available:

#### `meili:index:create` - Create a new MeiliSearch index

[](#meiliindexcreate---create-a-new-meilisearch-index)

**Arguments:**

- `index` : Index name

**Options:**

- `--force` : Force the operation to run

#### `meili:index:delete` - Delete a MeiliSearch index

[](#meiliindexdelete---delete-a-meilisearch-index)

**Arguments:**

- `index` : Index name

#### `meili:index:details` - Get details for a MeiliSearch index

[](#meiliindexdetails---get-details-for-a-meilisearch-index)

**Arguments:**

- `index` : Index name

#### `meili:index:reset` - Reset settings for a MeiliSearch index

[](#meiliindexreset---reset-settings-for-a-meilisearch-index)

**Arguments:**

- `index` : Index name

**Options:**

- `--pretend` : Only shows what changes would have been done to the index

#### `meili:index:view` - Get base information about a MeiliSearch index

[](#meiliindexview---get-base-information-about-a-meilisearch-index)

**Arguments:**

- `index` : Index name

**Options:**

- `--stats` : Whether to include index stats

#### `meili:indexes:list` - List all MeiliSearch indexes

[](#meiliindexeslist---list-all-meilisearch-indexes)

**Options:**

- `--stats` : Whether to include index stats

#### `meili:model:details` - Get details for a MeiliSearch model index

[](#meilimodeldetails---get-details-for-a-meilisearch-model-index)

**Arguments:**

- `model` : Model class

#### `meili:model:reset` - Reset settings for a MeiliSearch model index

[](#meilimodelreset---reset-settings-for-a-meilisearch-model-index)

**Arguments:**

- `model` : Model class

**Options:**

- `--pretend` : Only shows what changes would have been done to the index

#### `meili:model:synchronize` - Synchronize settings for a MeiliSearch model index

[](#meilimodelsynchronize---synchronize-settings-for-a-meilisearch-model-index)

**Arguments:**

- `model` : Model class

#### `meili:model:view` - Get base information about a MeiliSearch model index

[](#meilimodelview---get-base-information-about-a-meilisearch-model-index)

**Arguments:**

- `model` : Model class

**Options:**

- `--stats` : Whether to include index stats

**Options:**

- `--pretend` : Only shows what changes would have been done to the index

#### `meili:models:synchronize` - Synchronize all models implementing MeiliSearch index settings

[](#meilimodelssynchronize---synchronize-all-models-implementing-meilisearch-index-settings)

**Options:**

- `--pretend` : Only shows what changes would have been done to the indexes
- `--force` : Force the operation to run when in production

Examples
--------

[](#examples)

Model commands can take both full class name and base name, with the latter being completed using the configured paths.

```
$ php artisan meili:model:details App\\Models\\Article
$ php artisan meili:model:details Article

$ php artisan meili:model:reset App\\Models\\Article
$ php artisan meili:model:reset Article

$ php artisan meili:model:synchronize App\\Models\\Article
$ php artisan meili:model:synchronize Article

$ php artisan meili:model:view App\\Models\\Article
$ php artisan meili:model:view Article

```

Testing
-------

[](#testing)

Running tests can be done either through composer, or directly calling the PHPUnit binary.

```
$ composer test
```

To run tests with code coverage, please make sure that `phpdbg` exists and is executable.

```
$ composer test:coverage
```

Career
------

[](#career)

Dwarf A/S is a digital agency based in Copenhagen (Denmark) and established January 1st 2000.

We're always looking for new talent, so have a look at our [website](https://dwarf.dk/career/php-developer) for job openings.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance66

Regular maintenance activity

Popularity42

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~144 days

Recently: every ~246 days

Total

9

Last Release

273d ago

PHP version history (2 changes)0.1.0PHP ^7.4|^8.0

0.4.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/576237ccc9636e7055880eb47374b5b4e9fbcde17773fc5045dd53e99a2d6bac?d=identicon)[dwarfdk](/maintainers/dwarfdk)

---

Top Contributors

[![FrittenKeeZ](https://avatars.githubusercontent.com/u/1186125?v=4)](https://github.com/FrittenKeeZ "FrittenKeeZ (101 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (8 commits)")[![macbookandrew](https://avatars.githubusercontent.com/u/784333?v=4)](https://github.com/macbookandrew "macbookandrew (8 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

laravelmeilisearchscoutmeilisearchlaravelscoutmeilimeilitools

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/dwarfdk-laravel-meilitools/health.svg)

```
[![Health](https://phpackages.com/badges/dwarfdk-laravel-meilitools/health.svg)](https://phpackages.com/packages/dwarfdk-laravel-meilitools)
```

###  Alternatives

[omure/scout-advanced-meilisearch

Laravel Scout extension that allows to use meilisearch advanced features as well as has an extended collection driver for testing purposes.

123.9k](/packages/omure-scout-advanced-meilisearch)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
