- Notifications
You must be signed in to change notification settings - Fork8
Additional tools for Laravel Scout 9+ integration with MeiliSearch
License
dwarfhq/laravel-meilitools
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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.
| Engine | 0.1.x | 0.2.x | 0.3.x | 0.4.x |
|---|---|---|---|---|
| v0.26.x | X | X | ||
| v0.27.x | X | X | ||
| v0.28.x | X | |||
| v0.29.x | X | |||
| v0.30.x | X | |||
| v1.x.x | X |
Install this package via Composer:
$ composer require dwarfdk/laravel-meilitools
Publish config using Artisan command:
$ php artisan vendor:publish --provider="Dwarf\MeiliTools\MeiliToolsServiceProvider"Change configuration throughconfig/meilitools.php.
This package provides commands and helpers to ease the use of configuring MeiliSearch indexes.
Setup index settings for a model by implementing the method provided by the contract.
useDwarf\MeiliTools\Contracts\Indexes\MeiliSettings;useIlluminate\Database\Eloquent\Model;useIlluminate\Database\Eloquent\SoftDeletes;useLaravel\Scout\Searchable;class Articleextends Modelimplements MeiliSettings{use Searchable;use SoftDeletes;/** * {@inheritdoc} */publicfunctionmeiliSettings():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 foundhere.
The following commands are available:
Arguments:
index: Index name
Options:
--force: Force the operation to run
Arguments:
index: Index name
Arguments:
index: Index name
Arguments:
index: Index name
Options:
--pretend: Only shows what changes would have been done to the index
Arguments:
index: Index name
Options:
--stats: Whether to include index stats
Options:
--stats: Whether to include index stats
Arguments:
model: Model class
Arguments:
model: Model class
Options:
--pretend: Only shows what changes would have been done to the index
Arguments:
model: Model class
Arguments:
model: Model class
Options:
--stats: Whether to include index stats
Options:
--pretend: Only shows what changes would have been done to the index
Options:
--pretend: Only shows what changes would have been done to the indexes--force: Force the operation to run when in production
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 ArticleRunning tests can be done either through composer, or directly calling the PHPUnit binary.
$ composertestTo run tests with code coverage, please make sure thatphpdbg exists and is executable.
$ composer test:coverage
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 ourwebsite for job openings.
The MIT License (MIT). Please seeLicense File for more information.
About
Additional tools for Laravel Scout 9+ integration with MeiliSearch
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.