Learn how to use Meilisearch with Laravel Scout.
artisan
command:
config/scout.php
.
.env
file:
http://meilisearch:7700
(instead of say, http://localhost:7700
).
Laravel\Scout\Searchable
trait to your Eloquent models to make them searchable. This trait will use Laravel’s model observers to keep the data in your model in sync with Meilisearch.
Here’s an example model:
toSearchableArray
method. You can use this technique to store a model and its relationships’ data in the same document.
The example below shows how to store a model’s relationships data in Meilisearch:
config/scout.php
file:
Contact
model:
organization_id
field filterablename
and company_name
fields sortable