Installed Laravel Scout according to the following instructions:

1) Execute the command composer require laravel/scout

2) Added extension to providers 'Laravel\Scout\ScoutServiceProvider::class,'

3) Run the php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider" command php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"

4) Added extension in Model

 Laravel\Scout\Searchable use Searchable; 

5) composer require algolia/algoliasearch-client-php command composer require algolia/algoliasearch-client-php

6) The model now looks like this:

 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Laravel\Scout\Searchable; use DB; class Product extends Model { use Searchable; protected $table = 'products'; public static function getProductsBySearch($search) { // Список найденных продуктов $searchProducts = Product::search('Test') ->get() ->all(); return $searchProducts; } } 

At the output, I get the error:

 AlgoliaSearch requires an applicationID 

How to solve this problem? Thanks to all.

    1 answer 1

    Algolia is a search service where you will need to send documents for indexing, and then from there receive samples on request.

    1. You must register at https://www.algolia.com/
    2. In your account get app_id and scecret_key
    3. Specify their config Laravel (.env)

    ALGOLIA_APP_ID = XXXXX

    ALGOLIA_SECRET = XXXXXXXXXX

    1. Submit data for indexing:

      php artisan scout: import "App \ Product"

    In your personal Algolia account you can make sure that the data is received.