laravel_small_white Created with Sketch.


Install via composer

Add algolia/algoliasearch-laravel to your composer.json file:

composer require algolia/algoliasearch-laravel

Service provider

Add the service provider to config/app.php in the providers array.


Configure API Keys

Laravel Algolia requires a connection configuration. The package comes with a configuration files where you’ll set your Algolia credentials (applicationID and API Key). Add it to your project with the following command:

php artisan vendor:publish --provider="Vinkla\Algolia\AlgoliaServiceProvider"

This will create a config/algolia.php file in your app that you can modify to set your configuration. You can also create this file manually by copying the file vendor/vinkla/algolia/config/algolia.php to config/algolia.php.

We recommend to use environment specific variables like in the following example:

return [

    'default' => 'main',

    'connections' => [

        'main' => [
            'id' => env('ALGOLIA_APP_ID'),
            'key' => env('ALGOLIA_API_KEY'),



And set those value in your .env file.


NOTE: make sure you check for changes compared to the original config file after an upgrade. The original file can be found here vendor/vinkla/algolia/config/algolia.php.