Install the algolia/scout package

First, install Scout and Algolia’s API client via composer

composer require laravel/scout
composer require algolia/algoliasearch-client-php

Enabling scout

If you use Laravel 5.5, the package will be discovered automatically.

If you use a version <5.5, the service provider should be added to the providers array in the config/app.php file.


Configuring scout

Finally, you will need to publish the configuration file. This command will create a scout.php configuration file in your config directory.

php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"

Configure API Keys

You can set the keys directly inside the scout.php file that we just published but we recommend rather that you set the credentials (APP_ID and API Key) inside the .env file by adding the following content: