Scout Extended version | PHP version | Laravel version |
---|---|---|
3 | 8.1 and later | 10 and later |
8.0 and later | 9 and later | |
2 | 7.3 and later | 8 and later |
1 | 7.3 and later | 6 |
For more information, read the Scout Extended changelog.
-
Install Scout Extended with Composer:
-
Publish the Scout configuration to your
config
directory: -
For the model you would like to make searchable,
add the
Searchable
trait. For example, for anArticle
model (app/Models/Article.php
):PHPReplaceArticle
with a model used in your app. -
While not required, you should use a queue driver for Scout operations.
After configuring a queue driver, set
queue
totrue
in yourconfig/scout.php
file:PHP -
To access Algolia, copy your credentials from the Algolia dashboard to your
.env
file:<ALGOLIA_APP_ID>
. Your Algolia application ID.<ALGOLIA_API_KEY>
. Your API key withsearch
andaddObject
permissions.
-
To import existing data:
- If you’re importing from your Laravel database for the first time, use
scout:import
. - If you’ve installed Scout Extended in a Laravel Scout project, use
scout:reimport
.
If you make significant changes to your Scout configuration or need to reindex all your data, usescout:reimport
to ensure everything is in sync. - If you’re importing from your Laravel database for the first time, use
-
Open the
routes/web.php
file and add the following route to the bottom of the file:PHPReplaceArticle
with a model used in your app.